Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: zzkt/fluxus
base: c1f1299365
...
head fork: zzkt/fluxus
compare: 4afc552719
  • 13 commits
  • 19 files changed
  • 0 commit comments
  • 2 contributors
1  CHANGES
View
@@ -5,6 +5,7 @@ Fluxus : (C) 2008 Dave Griffiths : dave at pawfal dot org : www.pawfal.org
* compressed texture support
* added (midi-program) and (midi-cc-event) by Hugo van Galen
* midi out support
+* midi incremental cc messages (midi-set-cc-mode), (midi-get-cc-mode)
* updated to Racket
* added (draw-line)
* pixel primitives with more texture attachments for feedback effects and FFGL plugins
12 SConstruct
View
@@ -95,10 +95,14 @@ if env['PLATFORM'] == 'win32':
LibPaths += [ "/MinGW/lib" ]
if env['PLATFORM'] == 'darwin':
- IncludePaths += ['/opt/local/include', '/opt/local/include/freetype2',
- '/usr/X11/include', '/usr/X11/include/freetype2']
- LibPaths += ['/usr/X11/lib']
- if os.path.exists('/opt/local/lib'): LibPaths += ['/opt/local/lib']
+ if os.path.exists('/opt/local/lib'):
+ # macports
+ IncludePaths += ['/opt/local/include', '/opt/local/include/freetype2']
+ LibPaths += ['/opt/local/lib']
+ else:
+ # homebrew
+ IncludePaths += ['/usr/X11/include', '/usr/X11/include/freetype2']
+ LibPaths += ['/usr/X11/lib']
env.Append(CPPPATH = IncludePaths)
env.Append(LIBPATH = LibPaths)
2  docs/helpmap.scm
View
1 addition, 1 deletion not shown
2  examples/midi-test.scm
View
@@ -5,7 +5,7 @@
(display (midi-info))(newline)
-(midi-init 1)
+(midiin-open 0)
(define (midi-test)
(with-state
6 fluxa/SConscript
View
@@ -4,7 +4,7 @@
#
# Fluxus's synth and sampler server
-Import("env", "BinInstall")
+Import("env", "BinInstall", "Prefix")
Target = "fluxa"
Install = BinInstall
@@ -42,10 +42,10 @@ if env['PLATFORM'] == 'darwin' and GetOption('app'):
TOOL_BUNDLE(env)
Frameworks += ["Jackmp"]
- for l in ['sndfile']:
+ for l in ['sndfile', 'ogg', 'vorbis', 'vorbisenc', 'FLAC']:
if l in Libs:
Libs.remove(l)
- Libs.append(File('/opt/local/lib/lib%s.a' % l))
+ Libs.append(File('%s/lib/lib%s.a' % (Prefix, l)))
Libs.remove('jack')
env.Program(source = Source, target = Target, LIBS = Libs, FRAMEWORKS = Frameworks)
27 fluxa/src/Modules.cpp
View
@@ -640,7 +640,7 @@ void MoogFilter::Process(unsigned int BufSize, Sample &In, Sample *CutoffCV, Sam
///////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------VOWEL COEFFICIENTS
-const float coeff[5][11]= {
+const double coeff[5][11]= {
{ 8.11044e-06,
8.943665402, -36.83889529, 92.01697887, -154.337906, 181.6233289,
-151.8651235, 89.09614114, -35.10298511, 8.388101016, -0.923313471 ///A
@@ -695,18 +695,17 @@ void FormantFilter::Process(unsigned int BufSize, Sample &In, Sample *CutoffCV,
for (int v=0; v<5; v++)
{
res= (float) (coeff[v][0]*in +
- coeff[v][1]*memory[v][0] +
- coeff[v][2]*memory[v][1] +
- coeff[v][3]*memory[v][2] +
- coeff[v][4]*memory[v][3] +
- coeff[v][5]*memory[v][4] +
- coeff[v][6]*memory[v][5] +
- coeff[v][7]*memory[v][6] +
- coeff[v][8]*memory[v][7] +
- coeff[v][9]*memory[v][8] +
- coeff[v][10]*memory[v][9] );
-
-
+ coeff[v][1]*memory[v][0] +
+ coeff[v][2]*memory[v][1] +
+ coeff[v][3]*memory[v][2] +
+ coeff[v][4]*memory[v][3] +
+ coeff[v][5]*memory[v][4] +
+ coeff[v][6]*memory[v][5] +
+ coeff[v][7]*memory[v][6] +
+ coeff[v][8]*memory[v][7] +
+ coeff[v][9]*memory[v][8] +
+ coeff[v][10]*memory[v][9]);
+
memory[v][9]=memory[v][8];
memory[v][8]=memory[v][7];
memory[v][7]=memory[v][6];
@@ -716,7 +715,7 @@ void FormantFilter::Process(unsigned int BufSize, Sample &In, Sample *CutoffCV,
memory[v][3]=memory[v][2];
memory[v][2]=memory[v][1];
memory[v][1]=memory[v][0];
- memory[v][0]=(float) res;
+ memory[v][0]=(double) res;
o[v]=res;
}
3  fluxa/src/Modules.h
View
@@ -243,8 +243,7 @@ class FormantFilter : public Module
private:
float m_Vowel;
-
- float memory[5][10];
+ double memory[5][10];
};
// a wrapper for the other filters
1  libfluxus/src/FFGLManager.cpp
View
@@ -535,6 +535,7 @@ void FFGLManager::Render()
#endif
glPushAttrib(GL_VIEWPORT_BIT);
+ glColor4f(1, 1, 1, 1);
map<unsigned, FFGLPluginInstance *>::iterator i = m_PluginInstances.begin();
for (; i != m_PluginInstances.end(); ++i)
42 libfluxus/src/PixelPrimitive.cpp
View
@@ -303,9 +303,10 @@ void PixelPrimitive::Upload()
m_ReadyForUpload = true;
}
-void PixelPrimitive::Download()
+void PixelPrimitive::Download(unsigned handle /* = 0 */)
{
m_ReadyForDownload = true;
+ m_DownloadTextureHandle = handle;
}
void PixelPrimitive::Load(const string &filename)
@@ -334,7 +335,7 @@ void PixelPrimitive::Save(const string &filename) const
}
}
-void PixelPrimitive::Bind()
+void PixelPrimitive::Bind(int textureIndex /* = -1*/)
{
#ifndef DISABLE_RENDER_TO_TEXTURE
if (!m_FBOSupported)
@@ -345,7 +346,10 @@ void PixelPrimitive::Bind()
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBO);
/* set rendering */
- glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + m_RenderTextureIndex);
+ if (textureIndex == -1)
+ textureIndex = m_RenderTextureIndex;
+
+ glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + textureIndex);
#endif
}
@@ -502,30 +506,42 @@ void PixelPrimitive::DownloadPData()
{
if (m_FBOSupported)
{
- Bind();
- GLubyte *data = GetScreenBuffer(0, 0, m_Width, m_Height, 1);
- for (unsigned int i = 0; i < m_Width * m_Height; i++)
+ unsigned textureIndex = m_RenderTextureIndex;
+ if (m_DownloadTextureHandle == 0)
+ {
+ Bind();
+ }
+ else
{
- (*m_ColourData)[i].r = data[i*3] / 255.0f;
- (*m_ColourData)[i].g = data[i*3+1] / 255.0f;
- (*m_ColourData)[i].b = data[i*3+2] / 255.0f;
+ textureIndex = GetTextureIndex(m_DownloadTextureHandle);
+ Bind(textureIndex);
}
- free(data);
+
+ glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + textureIndex);
+ glPixelStorei(GL_PACK_ALIGNMENT, 1);
+ glReadPixels(0, 0, m_Width, m_Height, GL_RGBA, GL_FLOAT, &(*m_ColourData)[0]);
+
Unbind();
}
}
-void PixelPrimitive::SetRenderTexture(unsigned id)
+unsigned PixelPrimitive::GetTextureIndex(unsigned id)
{
- m_RenderTextureIndex = 0;
+ int index = 0;
for (unsigned i = 0; i < m_MaxTextures; i++)
{
if (m_Textures[i] == id)
{
- m_RenderTextureIndex = i;
+ index = i;
break;
}
}
+ return index;
+}
+
+void PixelPrimitive::SetRenderTexture(unsigned id)
+{
+ m_RenderTextureIndex = GetTextureIndex(id);
m_RenderTexture = m_Textures[m_RenderTextureIndex];
}
8 libfluxus/src/PixelPrimitive.h
View
@@ -58,7 +58,7 @@ class PixelPrimitive : public Primitive
void Upload();
/// Download the texture from the graphics card
- void Download();
+ void Download(unsigned handle = 0 );
/// Load a png file into this primitive
void Load(const string &filename);
@@ -84,7 +84,7 @@ class PixelPrimitive : public Primitive
/// Get the height
unsigned int GetHeight() { return m_Height; }
- void Bind();
+ void Bind(int texture = -1);
void Unbind();
/// Get the FBO width
@@ -114,9 +114,12 @@ class PixelPrimitive : public Primitive
unsigned m_MaxTextures;
unsigned *m_Textures; // attached textures
+
unsigned m_DisplayTexture; // id for rendering the primitive on screen
unsigned m_RenderTexture; // id for rendering into the fbo
unsigned m_RenderTextureIndex; // index for rendering into the fbo
+ unsigned GetTextureIndex(unsigned id);
+
unsigned m_DepthBuffer;
unsigned m_FBO;
@@ -132,6 +135,7 @@ class PixelPrimitive : public Primitive
bool m_ReadyForUpload;
bool m_ReadyForDownload;
+ unsigned m_DownloadTextureHandle;
bool m_FBOSupported;
bool m_RendererActive;
};
12 libfluxus/src/State.cpp
View
@@ -124,8 +124,11 @@ void State::Apply()
TexturePainter::Get()->SetCurrent(Textures,TextureStates);
- if (Shader!=NULL)
+ if (Shader != NULL)
{
+ if (Hints & HINT_POINTS)
+ glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+
Shader->Apply();
}
else GLSLShader::Unapply();
@@ -135,8 +138,15 @@ void State::Unapply()
{
if (Hints & HINT_NORMALISE)
glDisable(GL_NORMALIZE);
+
if (Hints & HINT_NOZWRITE)
glDepthMask(true);
+
+ if (Shader != NULL)
+ {
+ if (Hints & HINT_POINTS)
+ glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
+ }
}
void State::Spew()
15 modules/fluxus-engine/src/PrimitiveFunctions.cpp
View
@@ -1593,10 +1593,12 @@ Scheme_Object *pixels_upload(int argc, Scheme_Object **argv)
}
// StartFunctionDoc-en
-// pixels-download
+// pixels-download [texture-id]
// Returns: void
// Description:
// Downloads the texture data from the GPU to the PData array.
+// Optional texture id can be supplied to specify the pixel primitive
+// texture the data is downloaded from.
// Example:
// (clear)
//
@@ -1631,9 +1633,16 @@ Scheme_Object *pixels_download(int argc, Scheme_Object **argv)
{
// only if this is a pixel primitive
PixelPrimitive *pp = dynamic_cast<PixelPrimitive *>(Grabbed);
+ int handle = 0;
+ if (argc == 1)
+ {
+ ArgCheck("pixels-download", "i", argc, argv);
+ handle = IntFromScheme(argv[0]);
+ }
+
if (pp)
{
- pp->Download();
+ pp->Download(handle);
return scheme_void;
}
}
@@ -3393,7 +3402,7 @@ void PrimitiveFunctions::AddGlobals(Scheme_Env *env)
scheme_add_global("save-primitive", scheme_make_prim_w_arity(save_primitive, "save-primitive", 1, 1), env);
scheme_add_global("clear-geometry-cache", scheme_make_prim_w_arity(clear_geometry_cache, "clear-geometry-cache", 0, 0), env);
scheme_add_global("pixels-upload", scheme_make_prim_w_arity(pixels_upload, "pixels-upload", 0, 0), env);
- scheme_add_global("pixels-download", scheme_make_prim_w_arity(pixels_download, "pixels-download", 0, 0), env);
+ scheme_add_global("pixels-download", scheme_make_prim_w_arity(pixels_download, "pixels-download", 0, 1), env);
scheme_add_global("pixels-load", scheme_make_prim_w_arity(pixels_load, "pixels-load", 1, 1), env);
scheme_add_global("pixels-width", scheme_make_prim_w_arity(pixels_width, "pixels-width", 0, 0), env);
scheme_add_global("pixels-height", scheme_make_prim_w_arity(pixels_height, "pixels-height", 0, 0), env);
101 modules/fluxus-midi/src/FluxusMIDI.cpp
View
@@ -271,6 +271,103 @@ Scheme_Object *midiout_close(int argc, Scheme_Object **argv)
}
// StartFunctionDoc-en
+// midi-set-cc-mode mode-symbol
+// Returns: void
+// Description:
+// Sets the controller encoder mode. The mode can be 'absolute, 'doepfer or 'ableton.
+// The default is 'absolute. 'doepfer and 'ableton are incremental encoding modes.
+// Example:
+// (midi-set-cc-mode 'ableton)
+// EndFunctionDoc
+
+Scheme_Object *midi_set_cc_mode(int argc, Scheme_Object **argv)
+{
+ MZ_GC_DECL_REG(1);
+ MZ_GC_VAR_IN_REG(0, argv);
+ MZ_GC_REG();
+
+ if (!SCHEME_SYMBOLP(argv[0]))
+ scheme_wrong_type("midi-set-cc-mode", "symbol", 0, argc, argv);
+
+ string mode_str = scheme_symbol_name(argv[0]);
+
+ if (midilistener != NULL)
+ {
+ int mode = -1;
+
+ if (mode_str == "absolute")
+ {
+ mode = MIDIListener::MIDI_CC_ABSOLUTE;
+ }
+ else
+ if (mode_str == "doepfer")
+ {
+ mode = MIDIListener::MIDI_CC_DOEPFER;
+ }
+ else
+ if (mode_str == "ableton")
+ {
+ mode = MIDIListener::MIDI_CC_ABLETON;
+ }
+ else
+ {
+ cerr << "midi-set-cc-mode: unknown mode " << mode_str << endl;
+ }
+
+ if (mode != -1)
+ {
+ midilistener->set_cc_encoder_mode(mode);
+ }
+ }
+
+ MZ_GC_UNREG();
+ return scheme_void;
+}
+
+// StartFunctionDoc-en
+// midi-get-cc-mode
+// Returns: mode-symbol
+// Description:
+// Returns the controller encoder mode. The mode can be 'absolute, 'doepfer or 'ableton.
+// Example:
+// (define cc-mode (midi-get-cc-mode))
+// EndFunctionDoc
+
+Scheme_Object *midi_get_cc_mode(int argc, Scheme_Object **argv)
+{
+ Scheme_Object *ret = NULL;
+ MZ_GC_DECL_REG(2);
+ MZ_GC_VAR_IN_REG(0, argv);
+ MZ_GC_VAR_IN_REG(1, ret);
+ MZ_GC_REG();
+
+ if (midilistener != NULL)
+ {
+ int mode = midilistener->get_cc_encoder_mode();
+
+ switch (mode)
+ {
+ case MIDIListener::MIDI_CC_ABSOLUTE:
+ ret = scheme_make_symbol("absolute");
+ break;
+ case MIDIListener::MIDI_CC_DOEPFER:
+ ret = scheme_make_symbol("doepfer");
+ break;
+ case MIDIListener::MIDI_CC_ABLETON:
+ ret = scheme_make_symbol("ableton");
+ break;
+ default:
+ cerr << "midi-get-cc-mode: unknown mode " << mode << endl;
+ ret = scheme_void;
+ break;
+ }
+ }
+
+ MZ_GC_UNREG();
+ return ret;
+}
+
+// StartFunctionDoc-en
// midi-cc channel-number controller-number
// Returns: controller-value-number
// Description:
@@ -709,6 +806,10 @@ Scheme_Object *scheme_reload(Scheme_Env *env)
scheme_add_global("midi-info",
scheme_make_prim_w_arity(midi_info, "midi-info", 0, 0), menv);
+ scheme_add_global("midi-set-cc-mode",
+ scheme_make_prim_w_arity(midi_set_cc_mode, "midi-set-cc-mode", 1, 1), menv);
+ scheme_add_global("midi-get-cc-mode",
+ scheme_make_prim_w_arity(midi_get_cc_mode, "midi-get-cc-mode", 0, 0), menv);
scheme_add_global("midi-cc",
scheme_make_prim_w_arity(midi_cc, "midi-cc", 2, 2), menv);
scheme_add_global("midi-ccn",
72 modules/fluxus-midi/src/MIDIListener.cpp
View
@@ -51,7 +51,8 @@ void midi_callback(double deltatime, vector<unsigned char> *message,
MIDIListener::MIDIListener(int port /*= -1*/) :
midiin(NULL),
- last_event("")
+ last_event(""),
+ cc_encoder_mode(MIDI_CC_ABSOLUTE)
{
init_midi();
@@ -59,7 +60,7 @@ MIDIListener::MIDIListener(int port /*= -1*/) :
open(port);
/* allocate array for controller values and clear it */
- cntrl_values = new unsigned char[MAX_CNTRL];
+ cntrl_values = new signed char[MAX_CNTRL];
fill(cntrl_values, cntrl_values + MAX_CNTRL, 0);
/* likewise for the per channel "program" values */
@@ -209,6 +210,24 @@ void MIDIListener::close()
}
/**
+ * Sets controller encoder mode
+ * \param mode MIDI_CC_ABSOLUTE, MIDI_CC_ABLETON or MIDI_CC_DOEPFER
+ **/
+void MIDIListener::set_cc_encoder_mode(int mode)
+{
+ cc_encoder_mode = mode;
+}
+
+/**
+ * Returns current controller encoder mode
+ * \retval mode MIDI_CC_ABSOLUTE, MIDI_CC_ABLETON or MIDI_CC_DOEPFER
+ **/
+int MIDIListener::get_cc_encoder_mode(void)
+{
+ return cc_encoder_mode;
+}
+
+/**
* Returns controller values.
* \param channel MIDI channel
* \param cntrl_number controller number
@@ -223,8 +242,13 @@ int MIDIListener::get_cc(int channel, int cntrl_number)
return 0;
}
+ int i = (channel << 7) + cntrl_number;
pthread_mutex_lock(&mutex);
- int v = cntrl_values[(channel << 7) + cntrl_number];
+ int v = cntrl_values[i];
+ if (cc_encoder_mode != MIDI_CC_ABSOLUTE)
+ {
+ cntrl_values[i] = 0;
+ }
pthread_mutex_unlock(&mutex);
return v;
}
@@ -264,8 +288,13 @@ float MIDIListener::get_ccn(int channel, int cntrl_number)
return 0;
}
+ int i = (channel << 7) + cntrl_number;
pthread_mutex_lock(&mutex);
- float v = (float)cntrl_values[(channel << 7) + cntrl_number] / 127.0;
+ float v = (float)cntrl_values[i] / 127.0;
+ if (cc_encoder_mode != MIDI_CC_ABSOLUTE)
+ {
+ cntrl_values[i] = 0;
+ }
pthread_mutex_unlock(&mutex);
return v;
}
@@ -341,7 +370,7 @@ MIDIEvent *MIDIListener::get_cc_event(void)
int MIDIListener::get_bar(void)
{
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
int ret = bar;
pthread_mutex_unlock(&mutex);
return ret;
@@ -349,7 +378,7 @@ int MIDIListener::get_bar(void)
int MIDIListener::get_beat(void)
{
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
int ret = beat;
pthread_mutex_unlock(&mutex);
return ret;
@@ -357,7 +386,7 @@ int MIDIListener::get_beat(void)
int MIDIListener::get_pulse(void)
{
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
int ret = pulse;
pthread_mutex_unlock(&mutex);
return ret;
@@ -365,7 +394,7 @@ int MIDIListener::get_pulse(void)
int MIDIListener::get_beats_per_bar()
{
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
int ret = beats_per_bar;
pthread_mutex_unlock(&mutex);
return ret;
@@ -373,7 +402,7 @@ int MIDIListener::get_beats_per_bar()
int MIDIListener::get_clocks_per_beat()
{
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
int ret = clocks_per_beat;
pthread_mutex_unlock(&mutex);
return ret;
@@ -381,7 +410,7 @@ int MIDIListener::get_clocks_per_beat()
void MIDIListener::set_signature(int upper, int lower)
{
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
beats_per_bar = upper;
clocks_per_beat = (24*4)/lower;
pthread_mutex_unlock(&mutex);
@@ -449,10 +478,29 @@ void MIDIListener::callback(double deltatime, vector<unsigned char> *message)
case MIDIListener::MIDI_CONTROLLER:
if (count == 3)
{
- int cntrl_number = (*message)[1]; /* controller number */
+ int cntrl_number; /* controller number */
+
+ if (cc_encoder_mode == MIDI_CC_DOEPFER)
+ cntrl_number = (*message)[2];
+ else
+ cntrl_number = (*message)[1];
/* array index from channel and controller number */
int i = (ch << 7) + cntrl_number;
- int value = (*message)[2]; /* controller value */
+
+ int value; /* controller value */
+ if (cc_encoder_mode == MIDI_CC_DOEPFER)
+ {
+ value = (*message)[1] == 97 ? -1 : 1;
+ }
+ else
+ {
+ value = (*message)[2];
+ if ((cc_encoder_mode == MIDI_CC_ABLETON) && (value > 64))
+ {
+ value = 64 - value;
+ }
+ }
+
pthread_mutex_lock(&mutex);
cntrl_values[i] = value;
add_event(ch, cntrl_number, value);
15 modules/fluxus-midi/src/MIDIListener.h
View
@@ -63,6 +63,9 @@ class MIDIListener
void open(int port); /**< open a MIDI input connection */
void close(void); /**< close MIDI port */
+ void set_cc_encoder_mode(int mode);
+ int get_cc_encoder_mode(void);
+
int get_cc(int channel, int cntrl_number);
float get_ccn(int channel, int cntrl_number);
int get_program(int channel);
@@ -93,6 +96,13 @@ class MIDIListener
MIDI_CONTINUE = 0x0B,
MIDI_STOP = 0x0C
};
+ /** MIDI cc encoder types */
+ enum {
+ MIDI_CC_ABSOLUTE = 0,
+ MIDI_CC_DOEPFER, /* inc - cc#97 data=cc id, dec - cc#96, data=cc id */
+ MIDI_CC_ABLETON /* normal cc - data = 1-64 inc, 65-127 dec */
+ };
+
private:
void init_midi(void);
void add_note(int on_off, int ch, int note, int velocity);
@@ -107,16 +117,19 @@ class MIDIListener
string last_event; /**< last midi event as string */
/** array holding the current state of all, 16*128 controllers */
- unsigned char *cntrl_values;
+ signed char *cntrl_values;
/** array holding program number of 16 channels **/
unsigned char *pgm_values;
deque<MIDINote *> midi_notes;
deque<MIDIEvent *> midi_events;
+
/* song position */
int bar, beat, pulse;
int beats_per_bar, clocks_per_beat;
+
+ int cc_encoder_mode;
};
#endif
2  modules/fluxus-osc/src/FluxusOSC.cpp
View
@@ -393,7 +393,7 @@ Scheme_Object *osc_send(int argc, Scheme_Object **argv)
if (types[n]=='f') oscargs.push_back(new OSCFloat(scheme_real_to_double(SCHEME_VEC_ELS(argvec)[n])));
else if (types[n]=='i')
{
- unsigned long val=0;
+ uintptr_t val=0;
scheme_get_unsigned_int_val(SCHEME_VEC_ELS(argvec)[n],&val);
oscargs.push_back(new OSCInt(val));
}
18 modules/scheme/boot.scm
View
@@ -94,6 +94,24 @@
(inexact->exact (round (vector-ref screen-size 1)))))
;-------------------------------------------------
+; osx app specific section
+; add collects and search path on osx
+(when (eq? (system-type) 'macosx)
+ (let* ([home-dir (path->string (find-system-path 'home-dir))]
+ [fluxus-user-dir (string-append home-dir "Documents/Fluxus/")]
+ [fluxus-user-materials (string-append fluxus-user-dir "material/")]
+ [fluxus-user-collects (string-append fluxus-user-dir "collects/")])
+
+ (set-searchpaths
+ (cons fluxus-user-materials
+ (get-searchpaths)))
+
+ (current-library-collection-paths
+ (cons
+ fluxus-user-collects
+ (current-library-collection-paths)))))
+
+;-------------------------------------------------
; here is the hacking section
; todo: remove all below at some point
12 src/GLEditor.cpp
View
@@ -770,6 +770,18 @@ void GLEditor::Handle(int button, int key, int special, int state, int x, int y,
}
}
else
+ if (mod&GLUT_ACTIVE_ALT)
+ {
+ switch(key)
+ {
+ // alt+l = lambda
+ case 'l':
+ m_Text.insert(m_Position, L"\x3bb");
+ m_Position++;
+ break;
+ }
+ }
+ else
{
if (key!=0)
{
8 src/Repl.cpp
View
@@ -95,8 +95,8 @@ void Repl::Print(Scheme_Object *obj)
{
MZ_GC_DECL_REG(1);
MZ_GC_VAR_IN_REG(0, obj);
- MZ_GC_REG();
- long length=0;
+ MZ_GC_REG();
+ intptr_t length=0;
if (obj)
{
if (obj == scheme_multiple_values)
@@ -110,14 +110,14 @@ void Repl::Print(Scheme_Object *obj)
}
else
{
- char *str = scheme_display_to_string(obj, &length);
+ char *str = scheme_display_to_string(obj, &length);
Print(string_to_wstring(string(str)));
}
}
MZ_GC_UNREG();
}
-void Repl::Handle(int button, int key, int special, int state,
+void Repl::Handle(int button, int key, int special, int state,
int x, int y, int mod)
{

No commit comments for this range

Something went wrong with that request. Please try again.