Commit aec2dc0a authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@235 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 8a495ec2
make -f makefile.pd-linux
make -f makefile.pd-linux &&
{
echo Now install as root
su -c "make -f makefile.pd-linux install"
}
......@@ -23,7 +23,7 @@ TARGDIR=./pd-linux
# compiler+linker stuff
INCLUDES=$(PDPATH)
FLAGS=-DPD
FLAGS=-DPD
CFLAGS=-O6 -mcpu=pentiumpro
CFLAGS_D=-mcpu=pentiumpro -g
CFLAGS_T=-DFLEXT_THREADS
......@@ -38,7 +38,7 @@ NAME=flext
# all the source files from the package
SRCS=flbase.cpp flext.cpp flbuf.cpp fldsp.cpp fllib.cpp flxlet.cpp flsetup.cpp \
flutil.cpp flatom.cpp
flutil.cpp flatom.cpp flthr.cpp
HDRS=flstdc.h flbase.h flclass.h fldefs.h flext.h flthr.h fldsp.h
IHDRS=flinternal.h
......@@ -89,9 +89,10 @@ $(INSTDIR):
install:: $(INSTDIR)
install:: $(TARGET) $(TARGET_D) $(TARGET_T) $(TARGET_TD) $(HDRS)
install:: $(TARGET) $(TARGET_D) $(TARGET_T) $(TARGET_TD) $(patsubst %,source/%,$(HDRS))
cp $^ $(INSTDIR)
chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^))
chmod 755 $(patsubst %,$(INSTDIR)/%,$(notdir $^))
chown root.users $(patsubst %,$(INSTDIR)/%,$(notdir $^))
.PHONY: clean
clean:
......
......@@ -44,11 +44,11 @@ o Borland C++ 5.5 (free): edit & run "make -f makefile.bcc"
o Microsoft Visual C++ 6: use the "flext.dsp" project file
> you have to edit the pd path in the project properties/C-C++/preprocessor tab!
o Cygwin: edit & run "make -f makefile.cygwin" and "make -f makefile.cygwin install"
o Cygwin: edit "makefile.pd-cygwin" & run "sh build-pd-cygwin.sh"
pd - linux:
-----------
o GCC: edit & run "make -f makefile.pd-linux" and as root "make -f makefile.pd-linux install"
o GCC: edit "makefile.pd-linux" & run "sh build-pd-linux.sh"
Max/MSP - MacOS:
----------------
......@@ -81,6 +81,7 @@ Version history:
0.3.1:
- added some more functionality to the AtomList class
- fixed forgotten Sleep implementation in pd@unix
0.3.0:
- added CYGWIN support
......@@ -181,7 +182,7 @@ Restrictions in compatibility mode:
- Max allows only 9 float/int inlets
- Max allows only 3 type-checked creation arguments -> use variable argument lists for more
Porting to new platforms:
Porting to new compilers/platforms:
- enums must be int-sized
- compiler must support RTTI and bool type
......@@ -205,7 +206,6 @@ bugs:
- PD: problems with timed buffer redrawing (takes a lot of cpu time)
- hard thread termination upon object destruction doesn't seem to work properly -> crash
- Max rounding bug (at least version 4.0.5) ... buffer resize could be one sample less!
- Sleep unimplemented for pd@linux
tests:
- PD: figure out what "pointer" messages do and where they occur
......
......@@ -76,7 +76,9 @@ void flext_base::PopThread()
delete ti;
}
else {
post("%s - Internal error - Thread not found!",thisName());
#ifdef _DEBUG
post("%s - Am i too slow? - Thread not found!",thisName());
#endif
}
tlmutex.Unlock();
......
......@@ -20,6 +20,10 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <Threads.h>
#endif
#ifdef unix
#include <unistd.h>
#endif
t_atom *flext_base::CopyList(int argc,const t_atom *argv)
{
int i;
......@@ -51,6 +55,6 @@ void flext_base::Sleep(float s)
YieldToAnyThread(); // should we really yield?
}
#else
#pragma message("Sleep not defined")
usleep((long)(s*1000000));
#endif
}
......@@ -12,8 +12,8 @@ This is an example of a simplified prepend object
#include <flext.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 300)
#error You need at least flext version 0.3.0
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 301)
#error You need at least flext version 0.3.1
#endif
......@@ -25,12 +25,11 @@ class adv1:
public:
// constructor with variable argument list
adv1(int argc,t_atom *argv);
~adv1();
protected:
void m_any(t_symbol *s,int argc,t_atom *argv); // method which digests anything
AtomList *lst;
AtomList lst;
private:
FLEXT_CALLBACK_A(m_any); // callback for method "m_any" (with anything argument)
};
......@@ -43,8 +42,7 @@ FLEXT_NEW_V("adv1 prepend",adv1)
// constructor
adv1::adv1(int argc,t_atom *argv):
lst(NULL)
adv1::adv1(int argc,t_atom *argv)
{
AddInAnything(); // one inlet that can receive anything
AddOutAnything(); // one outlet for anything
......@@ -57,7 +55,7 @@ adv1::adv1(int argc,t_atom *argv):
if(argc != 0) { // check for arg count
// store arg list
lst = new AtomList(argc,argv);
lst(argc,argv);
}
else {
// no args given
......@@ -69,28 +67,24 @@ adv1::adv1(int argc,t_atom *argv):
}
// destructor
adv1::~adv1() { if(lst) delete lst; }
// method
void adv1::m_any(t_symbol *s,int argc,t_atom *argv)
{
// reserve space for as many atoms as possibly necessary
AtomList result(lst->Count()+argc+2);
AtomList result(lst.Count()+argc+2);
// ix is our counter of atoms to output
int ix = 0;
int i = 0;
if(!IsSymbol((*lst)[0])) {
if(!IsSymbol(lst[0])) {
// if first element to prepend is no symbol then make it a "list"
SetSymbol(result[ix++],sym_list);
}
// copy atoms to prepend to result list
for(; i < lst->Count(); ++i) CopyAtom(&result[ix++],&(*lst)[i]);
for(; i < lst.Count(); ++i) CopyAtom(&result[ix++],&lst[i]);
// if anything is no "list" or "float" then append it to result list
if(s != sym_list && s != sym_float)
......
#N canvas 383 293 460 310 12;
#X msg 39 34 or two words;
#X msg 154 35 2 3;
#X msg 47 252 one or two words;
#N canvas 175 265 667 312 12;
#X msg 35 31 or two words;
#X msg 167 31 2 3;
#X msg 47 252 one 2 3;
#X obj 85 154 print result;
#X obj 69 123 adv1 one;
#X obj 47 224 prepend set;
#X text 146 217 you can also use "prepend" if "adv1" has already been
#X text 154 216 you can also use "prepend" if "adv1" has already been
loaded!;
#X connect 0 0 4 0;
#X connect 1 0 4 0;
......
......@@ -8,9 +8,9 @@
-1;
#X text 29 136 sample rate;
#X text 136 136 block size;
#X text 242 137 channels in;
#X text 342 137 and out;
#X text 116 29 bang to get audio system parameters;
#X text 342 137;
#X text 242 137 channels in and out;
#X connect 0 0 1 0;
#X connect 0 1 2 0;
#X connect 0 2 3 0;
......
#N canvas 197 285 454 304 12;
#X obj 110 96 simple2 3;
#X floatatom 98 51 5 0 0;
#X floatatom 187 52 5 0 0;
#X floatatom 199 52 5 0 0;
#X floatatom 108 150 5 0 0;
#X msg 11 12 help;
#X text 90 30 triggering;
#X text 190 31 non-triggering;
#X text 187 95 default argument;
#X text 202 31 non-triggering;
#X text 196 96 default argument;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 0 1;
......
......@@ -17,8 +17,8 @@ This shows an example of a method running as a thread
#include <flext.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 300)
#error You need at least flext version 0.3.0
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 301)
#error You need at least flext version 0.3.1
#endif
......
......@@ -17,8 +17,8 @@ This shows an example of multiple threads and syncing with a thread conditional
#include <flext.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 300)
#error You need at least flext version 0.3.0
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 301)
#error You need at least flext version 0.3.1
#endif
......@@ -79,7 +79,6 @@ void thread2::m_start(int st)
if(running) { count = st; return; }
running = true;
blipping = false;
// loop until either the system exit flag or the "stopit" flag is set
for(count = st; !ShouldExit() && !stopit; ++count)
......@@ -118,6 +117,7 @@ void thread2::m_text()
void thread2::m_textout()
{
if(blipping) return;
blipping = true;
while(!ShouldExit() && !stopit) {
......@@ -129,4 +129,4 @@ void thread2::m_textout()
blipping = false; // change state flag
cond.Signal(); // signal changed flag to watiting "stop" method
cond.Unlock(); // unlock conditional
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment