Logo Search packages:      
Sourcecode: csound version File versions  Download package

CsoundGUIMain_FLTK.cpp

// generated by Fast Light User Interface Designer (fluid) version 1.0107

#include <string>
#include "CsoundGUI.hpp"

void CsoundGUIMain::cb_orcNameInput_i(Fl_Input* o, void*) {
  stripString(currentPerformanceSettings.orcName, o->value());
updateGUIState_orcName();
}
void CsoundGUIMain::cb_orcNameInput(Fl_Input* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_orcNameInput_i(o,v);
}

void CsoundGUIMain::cb_orcNameButton_i(Fl_Button*, void*) {
  pushOpenOrcButton();
}
void CsoundGUIMain::cb_orcNameButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_orcNameButton_i(o,v);
}

void CsoundGUIMain::cb_editOrcButton_i(Fl_Button*, void*) {
  editOrcFile();
}
void CsoundGUIMain::cb_editOrcButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_editOrcButton_i(o,v);
}

void CsoundGUIMain::cb_scoreNameInput_i(Fl_Input* o, void*) {
  stripString(currentPerformanceSettings.scoName, o->value());
updateGUIState_scoName();
}
void CsoundGUIMain::cb_scoreNameInput(Fl_Input* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_scoreNameInput_i(o,v);
}

void CsoundGUIMain::cb_scoreNameButton_i(Fl_Button*, void*) {
  pushOpenScoButton();
}
void CsoundGUIMain::cb_scoreNameButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_scoreNameButton_i(o,v);
}

void CsoundGUIMain::cb_editScoreButton_i(Fl_Button*, void*) {
  editScoreFile();
}
void CsoundGUIMain::cb_editScoreButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_editScoreButton_i(o,v);
}

void CsoundGUIMain::cb_outfileNameInput_i(Fl_Input* o, void*) {
  stripString(currentPerformanceSettings.outputFileName, o->value());
updateGUIState_outFile();
}
void CsoundGUIMain::cb_outfileNameInput(Fl_Input* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_outfileNameInput_i(o,v);
}

void CsoundGUIMain::cb_outfileNameButton_i(Fl_Button*, void*) {
  {
  CsoundGUIMain::browseFile(currentPerformanceSettings.outputFileName, "Select output sound file", CSOUND5GUI_FILETYPE_AUDIO, true);
  outfileNameInput->value(currentPerformanceSettings.outputFileName.c_str());
  updateGUIState_outFile();
};
}
void CsoundGUIMain::cb_outfileNameButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_outfileNameButton_i(o,v);
}

void CsoundGUIMain::cb_editOutfileButton_i(Fl_Button*, void*) {
  editSoundFile(currentPerformanceSettings.outputFileName.c_str());
}
void CsoundGUIMain::cb_editOutfileButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_editOutfileButton_i(o,v);
}

void CsoundGUIMain::cb_playOutfileButton_i(Fl_Button*, void*) {
  playSoundFile(currentPerformanceSettings.outputFileName.c_str());
}
void CsoundGUIMain::cb_playOutfileButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_playOutfileButton_i(o,v);
}

void CsoundGUIMain::cb_realtimeIOToggle_i(Fl_Check_Button* o, void*) {
  setRealtimeCheckbox(o->value());
}
void CsoundGUIMain::cb_realtimeIOToggle(Fl_Check_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_realtimeIOToggle_i(o,v);
}

void CsoundGUIMain::cb_configureRealtimeIO_i(Fl_Button*, void*) {
  openPerformanceSettingsWindow(2);
}
void CsoundGUIMain::cb_configureRealtimeIO(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_configureRealtimeIO_i(o,v);
}

void CsoundGUIMain::cb_playButton_i(Fl_Button*, void*) {
  pushPlayPauseButton();
}
void CsoundGUIMain::cb_playButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_playButton_i(o,v);
}

void CsoundGUIMain::cb_fastForwardButton_i(Fl_Button*, void*) {
  if (performing && csPerf != (CsoundPerformance*) 0)
  csPerf->AdvanceScoreTime(10.0);
}
void CsoundGUIMain::cb_fastForwardButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_fastForwardButton_i(o,v);
}

void CsoundGUIMain::cb_stopButton_i(Fl_Button*, void*) {
  pushStopButton();
}
void CsoundGUIMain::cb_stopButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_stopButton_i(o,v);
}

void CsoundGUIMain::cb_applyScoreOffsetButton_i(Fl_Button*, void*) {
  if (performing && csPerf != (CsoundPerformance*) 0) {
  if (currentPerformanceSettings.scoreOffsetSeconds >= 0.0)
    csPerf->SetScoreOffsetSeconds(currentPerformanceSettings.scoreOffsetSeconds, true);
};
}
void CsoundGUIMain::cb_applyScoreOffsetButton(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_applyScoreOffsetButton_i(o,v);
}

void CsoundGUIMain::cb_scoreOffsetInput_i(Fl_Value_Input* o, void*) {
  currentPerformanceSettings.scoreOffsetSeconds = o->value();
if (performing && csPerf != (CsoundPerformance*) 0)
  csPerf->SetScoreOffsetSeconds(currentPerformanceSettings.scoreOffsetSeconds, false);
}
void CsoundGUIMain::cb_scoreOffsetInput(Fl_Value_Input* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_scoreOffsetInput_i(o,v);
}

void CsoundGUIMain::cb_Options_i(Fl_Menu_Button* o, void*) {
  if (o->value() == 0)
  openGlobalSettingsWindow();
else if (o->value() == 1)
  openPerformanceSettingsWindow();
}
void CsoundGUIMain::cb_Options(Fl_Menu_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_Options_i(o,v);
}

void CsoundGUIMain::cb_Utilities_i(Fl_Button*, void*) {
  openUtilitiesWindow();
}
void CsoundGUIMain::cb_Utilities(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_Utilities_i(o,v);
}

void CsoundGUIMain::cb_Messages_i(Fl_Button*, void*) {
  if (!consoleWindow.window->shown()) {
  consoleWindow.window->show();
  consoleWindow.window->resize(currentGlobalSettings.consolePosX,
                                currentGlobalSettings.consolePosY,
                                currentGlobalSettings.consoleWidth,
                                currentGlobalSettings.consoleHeight);
  }
else {
  currentGlobalSettings.consolePosX = consoleWindow.window->x();
  currentGlobalSettings.consolePosY = consoleWindow.window->y();
  currentGlobalSettings.consoleWidth = consoleWindow.window->w();
  currentGlobalSettings.consoleHeight = consoleWindow.window->h();
  consoleWindow.window->hide();
  };
}
void CsoundGUIMain::cb_Messages(Fl_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_Messages_i(o,v);
}

void CsoundGUIMain::cb_Help_i(Fl_Menu_Button* o, void*) {
  if (o->value() == 0)
  runHelpBrowser("index.html");
else if (o->value() == 1)
  openAboutWindow();
}
void CsoundGUIMain::cb_Help(Fl_Menu_Button* o, void* v) {
  ((CsoundGUIMain*)(o->parent()->parent()->user_data()))->cb_Help_i(o,v);
}

CsoundGUIMain::CsoundGUIMain() {
  Fl_Double_Window* w;
  {
  csound = (CSOUND*) 0;
  csPerf = (CsoundPerformance*) 0;
  prvTime = -1;
  performing = false;
  paused = true;
  globalSettingsWindow = (CsoundGlobalSettingsPanel*) 0;
  performanceSettingsWindow = (CsoundPerformanceSettingsPanel*) 0;
  utilitiesWindow = (CsoundUtilitiesWindow*) 0;
  orcEditorWindow = (CsoundEditorWindow*) 0;
  scoEditorWindow = (CsoundEditorWindow*) 0;
  aboutWindow = (CsoundAboutWindow*) 0;
  utility_listOpcodes = (CsoundUtility*) 0;
  utility_cvanal = (CsoundUtility*) 0;
  utility_pvanal = (CsoundUtility*) 0;
  utility_hetro = (CsoundUtility*) 0;
  utility_lpanal = (CsoundUtility*) 0;
  utility_sndinfo = (CsoundUtility*) 0;
  utility_srconv = (CsoundUtility*) 0;
  utility_dnoise = (CsoundUtility*) 0;
  utilityState = 0;
}
  { Fl_Double_Window* o = window = new Fl_Double_Window(440, 335, "Csound 5 GUI");
    w = o;
    o->color(FL_FOREGROUND_COLOR);
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(5, 5, 430, 100);
      o->box(FL_PLASTIC_UP_BOX);
      o->color((Fl_Color)139);
      o->selection_color((Fl_Color)35);
      { Fl_Input* o = orcNameInput = new Fl_Input(45, 25, 325, 25, "Orchestra/CSD");
        o->box(FL_THIN_DOWN_BOX);
        o->color((Fl_Color)55);
        o->callback((Fl_Callback*)cb_orcNameInput);
        o->align(FL_ALIGN_TOP);
        o->value(currentPerformanceSettings.orcName.c_str());
      }
      { Fl_Button* o = orcNameButton = new Fl_Button(15, 25, 25, 25, "...");
        o->tooltip("Browse orchestra or CSD file");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_orcNameButton);
      }
      { Fl_Button* o = editOrcButton = new Fl_Button(375, 25, 50, 25, "Edit");
        o->tooltip("Open orchestra or CSD file with external editor");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_editOrcButton);
      }
      { Fl_Input* o = scoreNameInput = new Fl_Input(45, 70, 325, 25, "Score file");
        o->box(FL_THIN_DOWN_BOX);
        o->color((Fl_Color)55);
        o->callback((Fl_Callback*)cb_scoreNameInput);
        o->align(FL_ALIGN_TOP);
        o->value(currentPerformanceSettings.scoName.c_str());
      }
      { Fl_Button* o = scoreNameButton = new Fl_Button(15, 70, 25, 25, "...");
        o->tooltip("Browse score file");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_scoreNameButton);
      }
      { Fl_Button* o = editScoreButton = new Fl_Button(375, 70, 50, 25, "Edit");
        o->tooltip("Open score file with external editor");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_editScoreButton);
      }
      o->end();
    }
    { Fl_Group* o = new Fl_Group(5, 110, 430, 85);
      o->box(FL_PLASTIC_UP_BOX);
      o->color((Fl_Color)139);
      o->selection_color((Fl_Color)35);
      o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { Fl_Input* o = outfileNameInput = new Fl_Input(50, 130, 260, 25, "Output file/device");
        o->box(FL_THIN_DOWN_BOX);
        o->callback((Fl_Callback*)cb_outfileNameInput);
        o->align(FL_ALIGN_TOP);
        o->value(currentPerformanceSettings.outputFileName.c_str());
      }
      { Fl_Button* o = outfileNameButton = new Fl_Button(15, 130, 25, 25, "...");
        o->tooltip("Browse sound output file");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_outfileNameButton);
      }
      { Fl_Button* o = editOutfileButton = new Fl_Button(375, 130, 50, 25, "Edit");
        o->tooltip("Open output sound file with external editor");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_editOutfileButton);
      }
      { Fl_Button* o = playOutfileButton = new Fl_Button(320, 130, 45, 25, "@>");
        o->tooltip("Listen to output sound file with external player");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_playOutfileButton);
      }
      { Fl_Check_Button* o = realtimeIOToggle = new Fl_Check_Button(45, 160, 120, 25, "Realtime I/O");
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->callback((Fl_Callback*)cb_realtimeIOToggle);
      }
      { Fl_Button* o = configureRealtimeIO = new Fl_Button(190, 160, 120, 25, "Configure");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_configureRealtimeIO);
      }
      o->end();
    }
    { Fl_Group* o = new Fl_Group(5, 200, 225, 130);
      o->box(FL_PLASTIC_UP_BOX);
      o->color((Fl_Color)139);
      o->selection_color((Fl_Color)35);
      { Fl_Output* o = scoreTimeDisplay = new Fl_Output(15, 210, 205, 50);
        o->tooltip("The current score time (hh:mm:ss)");
        o->box(FL_EMBOSSED_BOX);
        o->color(FL_GRAY0);
        o->selection_color(FL_BACKGROUND2_COLOR);
        o->labelfont(13);
        o->textfont(4);
        o->textsize(24);
        o->textcolor(23);
        o->value("  --:--:--.-");
      }
      { Fl_Button* o = rewindButton = new Fl_Button(15, 264, 50, 25, "@|<");
        o->tooltip("Rewind to the beginning of the score");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
      }
      { Fl_Button* o = playButton = new Fl_Button(66, 264, 50, 25, "@>");
        o->tooltip("Play/Pause");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_playButton);
      }
      { Fl_Button* o = fastForwardButton = new Fl_Button(118, 264, 50, 25, "@>>");
        o->tooltip("Fast forward 10 seconds");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_fastForwardButton);
      }
      { Fl_Button* o = stopButton = new Fl_Button(170, 264, 50, 25, "@square");
        o->tooltip("Stop");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_stopButton);
      }
      { Fl_Button* o = applyScoreOffsetButton = new Fl_Button(15, 295, 50, 25, "Goto");
        o->tooltip("Set the current score position to the specified offset");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->callback((Fl_Callback*)cb_applyScoreOffsetButton);
      }
      { Fl_Value_Input* o = scoreOffsetInput = new Fl_Value_Input(78, 295, 72, 25, "Seconds");
        o->tooltip("Score offset in seconds");
        o->box(FL_THIN_DOWN_BOX);
        o->maximum(10000);
        o->callback((Fl_Callback*)cb_scoreOffsetInput);
        o->align(FL_ALIGN_RIGHT);
        o->value(currentPerformanceSettings.scoreOffsetSeconds);
      }
      o->end();
    }
    { Fl_Group* o = new Fl_Group(235, 200, 200, 75);
      o->box(FL_PLASTIC_UP_BOX);
      o->color((Fl_Color)139);
      o->selection_color(FL_LIGHT1);
      { Fl_Menu_Button* o = new Fl_Menu_Button(245, 210, 85, 25, "Options");
        o->tooltip("Set options for Csound and the GUI interface");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->selection_color(FL_LIGHT1);
        o->callback((Fl_Callback*)cb_Options);
        o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
        o->add("GUI...|Csound...");
        o->value(0);
      }
      { Fl_Button* o = new Fl_Button(245, 240, 85, 25, "Utilities...");
        o->tooltip("Open Csound utilities dialog");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->selection_color(FL_LIGHT1);
        o->callback((Fl_Callback*)cb_Utilities);
        o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      }
      { Fl_Button* o = new Fl_Button(340, 210, 85, 25, "Messages");
        o->tooltip("Show/Hide Csound console messages");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->selection_color(FL_LIGHT1);
        o->callback((Fl_Callback*)cb_Messages);
        o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      }
      { Fl_Menu_Button* o = new Fl_Menu_Button(340, 240, 85, 25, "Help");
        o->box(FL_PLASTIC_UP_BOX);
        o->down_box(FL_PLASTIC_DOWN_BOX);
        o->color((Fl_Color)25);
        o->selection_color(FL_LIGHT1);
        o->callback((Fl_Callback*)cb_Help);
        o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
        o->add("Manual|About");
        o->value(0);
      }
      o->end();
    }
    { Fl_Group* o = new Fl_Group(235, 280, 200, 50, "Csound5 GUI");
      o->tooltip("This is the FLTK frontend for Csound5");
      o->box(FL_ROUNDED_FRAME);
      o->selection_color((Fl_Color)55);
      o->labeltype(FL_SHADOW_LABEL);
      o->labelfont(5);
      o->labelsize(24);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
      o->end();
    }
    o->end();
  }
}

Generated by  Doxygen 1.6.0   Back to index