mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Working on GUI feedback for Input section, fixed bugs in process staying alive if OptionsWindow is shown
This commit is contained in:
parent
316ea7e668
commit
52c73d787c
16 changed files with 111 additions and 14 deletions
|
@ -39,6 +39,8 @@ class Controller
|
|||
virtual std::string getName() = 0;
|
||||
|
||||
/// master
|
||||
virtual void masterInputTo(int to,float f){}
|
||||
virtual void masterInputToActive(int to,float f){}
|
||||
virtual void masterVolume(float f){}
|
||||
virtual void metronomeEnable(bool b){}
|
||||
|
||||
|
|
|
@ -17,6 +17,18 @@ LupppGUI::LupppGUI() :
|
|||
{
|
||||
}
|
||||
|
||||
void LupppGUI::masterInputTo(int to,float f)
|
||||
{
|
||||
EventMasterInputTo e( (Event::INPUT_TO)to, f );
|
||||
writeToGuiRingbuffer( &e );
|
||||
}
|
||||
|
||||
void LupppGUI::masterInputToActive(int to,float f)
|
||||
{
|
||||
EventMasterInputToActive e( (Event::INPUT_TO)to, f );
|
||||
writeToGuiRingbuffer( &e );
|
||||
}
|
||||
|
||||
void LupppGUI::masterVolume(float f)
|
||||
{
|
||||
EventTrackVol e( -1, f );
|
||||
|
|
|
@ -15,6 +15,8 @@ class LupppGUI : public Controller
|
|||
std::string getName(){return "Luppp GUI";}
|
||||
|
||||
void masterVolume(float f);
|
||||
void masterInputTo(int to,float f);
|
||||
void masterInputToActive(int to,float f);
|
||||
|
||||
void metronomeEnable(bool b);
|
||||
|
||||
|
|
|
@ -61,6 +61,17 @@ void ControllerUpdater::setTrackSend(int t, int send, float v)
|
|||
c.at(i)->trackSend(t, send, v);
|
||||
}
|
||||
|
||||
void ControllerUpdater::masterInputToActive(int to, bool v)
|
||||
{
|
||||
for(unsigned int i = 0; i < c.size(); i++)
|
||||
c.at(i)->masterInputToActive( to, v);
|
||||
}
|
||||
void ControllerUpdater::masterInputTo( int to, float v )
|
||||
{
|
||||
for(unsigned int i = 0; i < c.size(); i++)
|
||||
c.at(i)->masterInputTo( to, v);
|
||||
}
|
||||
|
||||
void ControllerUpdater::launchScene( int scene )
|
||||
{
|
||||
for(unsigned int i = 0; i < c.size(); i++)
|
||||
|
|
|
@ -38,6 +38,8 @@ class ControllerUpdater
|
|||
void mute(int t, bool b);
|
||||
|
||||
void masterVolume(float v);
|
||||
void masterInputToActive(int to, bool v);
|
||||
void masterInputTo( int inputTo, float vol );
|
||||
|
||||
void setTrackSceneProgress(int t, int s, float p);
|
||||
void setTrackSendActive(int t, int send, bool v);
|
||||
|
|
|
@ -51,12 +51,33 @@ void handleGuiEvents()
|
|||
LUPPP_NOTE("Gui Samplerate: %i", gui->samplerate);
|
||||
} break; }
|
||||
|
||||
/// master
|
||||
case Event::MASTER_INPUT_TO: {
|
||||
if ( availableRead >= sizeof(EventMasterInputTo) ) {
|
||||
EventMasterInputTo ev;
|
||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventMasterInputTo) );
|
||||
gui->getMasterTrack()->setInputTo( (int)ev.place, ev.value );
|
||||
} break; }
|
||||
case Event::MASTER_INPUT_TO_ACTIVE: {
|
||||
if ( availableRead >= sizeof(EventMasterInputToActive) ) {
|
||||
EventMasterInputToActive ev;
|
||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventMasterInputToActive) );
|
||||
gui->getMasterTrack()->setInputToActive( (int)ev.place, ev.active );
|
||||
} break; }
|
||||
case Event::MASTER_INPUT_VOL: {
|
||||
if ( availableRead >= sizeof(EventMasterInputVol) ) {
|
||||
EventMasterInputVol ev;
|
||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventMasterInputVol) );
|
||||
gui->getMasterTrack()->setInputVol( ev.vol );
|
||||
} break; }
|
||||
case Event::MASTER_VOL: {
|
||||
if ( availableRead >= sizeof(EventMasterVol) ) {
|
||||
EventMasterVol ev(0);
|
||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventMasterVol) );
|
||||
//jack->masterVolume = ev.vol;
|
||||
|
||||
} break; }
|
||||
|
||||
|
||||
case Event::METRONOME_ACTIVE: {
|
||||
if ( availableRead >= sizeof(EventMetronomeActive) ) {
|
||||
EventMetronomeActive ev(false);
|
||||
|
|
|
@ -75,6 +75,12 @@ void AudioEditor::show( AudioBuffer* buf, bool modal )
|
|||
window->show();
|
||||
}
|
||||
|
||||
void AudioEditor::hide()
|
||||
{
|
||||
window->hide();
|
||||
}
|
||||
|
||||
|
||||
void AudioEditor::setBeatsAndQuit(int beats)
|
||||
{
|
||||
ab->setBeats(beats);
|
||||
|
|
|
@ -21,6 +21,8 @@ class AudioEditor
|
|||
/// shows the window, and loads the audio buffer into the display
|
||||
void show( AudioBuffer* ab, bool modal = false );
|
||||
|
||||
void hide();
|
||||
|
||||
/// returns true if the editor window is shown
|
||||
bool shown();
|
||||
|
||||
|
|
|
@ -195,6 +195,31 @@ void GMasterTrack::setBpm( int b )
|
|||
tempoDial.value( ( bpm - 60 ) / 160.f );
|
||||
}
|
||||
|
||||
void GMasterTrack::setInputVol(float f)
|
||||
{
|
||||
inputVolume.value( f );
|
||||
}
|
||||
|
||||
void GMasterTrack::setInputTo(int to, float f)
|
||||
{
|
||||
if ( to == Event::INPUT_TO_MIX )
|
||||
inputToMixVol.value( f );
|
||||
else if ( to == Event::INPUT_TO_MIX )
|
||||
inputToSendVol.value( f );
|
||||
else if ( to == Event::INPUT_TO_XSIDE )
|
||||
inputToSidechainSignalVol.value( f );
|
||||
}
|
||||
|
||||
void GMasterTrack::setInputToActive(int to, bool f)
|
||||
{
|
||||
if ( to == Event::INPUT_TO_MIX )
|
||||
inputToMix.value( f );
|
||||
else if ( to == Event::INPUT_TO_MIX )
|
||||
inputToSend.value( f );
|
||||
else if ( to == Event::INPUT_TO_SIDE_KEY )
|
||||
inputToSidechainKey.value( f );
|
||||
}
|
||||
|
||||
void GMasterTrack::metronomeEnable( bool b )
|
||||
{
|
||||
metronomeButton.value( b );
|
||||
|
|
|
@ -36,6 +36,10 @@ class GMasterTrack : public Fl_Group
|
|||
void setTapTempo( bool b );
|
||||
void setBarBeat(int b, int beat);
|
||||
|
||||
void setInputVol(float f);
|
||||
void setInputTo(int to, float f);
|
||||
void setInputToActive(int to, bool f);
|
||||
|
||||
void metronomeEnable( bool b );
|
||||
|
||||
Avtk::Volume* getInputVolume();
|
||||
|
|
|
@ -167,6 +167,11 @@ void OptionsWindow::show()
|
|||
window->show();
|
||||
}
|
||||
|
||||
void OptionsWindow::hide()
|
||||
{
|
||||
window->hide();
|
||||
}
|
||||
|
||||
void OptionsWindow::setBindEnable(bool e)
|
||||
{
|
||||
LUPPP_NOTE("setBindEnable() %i", int(e) );
|
||||
|
|
|
@ -23,6 +23,8 @@ class OptionsWindow
|
|||
OptionsWindow();
|
||||
|
||||
void show();
|
||||
void hide();
|
||||
|
||||
void setTarget(const char* t);
|
||||
void setBindEnable(bool b);
|
||||
|
||||
|
|
|
@ -434,7 +434,14 @@ int Gui::show()
|
|||
|
||||
int Gui::quit()
|
||||
{
|
||||
// close JACK client
|
||||
jack->quit();
|
||||
|
||||
// ensure the subwindows are closed
|
||||
optionWindow->hide();
|
||||
audioEditor->hide();
|
||||
|
||||
// quit main window, causing program termination
|
||||
window.hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,20 +30,16 @@ void Logic::masterInputVol( float v )
|
|||
jack->inputVolume( v );
|
||||
}
|
||||
|
||||
void Logic::masterInputTo( Event::INPUT_TO inputTo, float v)
|
||||
void Logic::masterInputTo( int to, float v )
|
||||
{
|
||||
jack->inputTo( inputTo, v );
|
||||
jack->inputTo( (Event::INPUT_TO)to, v );
|
||||
jack->getControllerUpdater()->masterInputTo( to, v );
|
||||
}
|
||||
|
||||
void Logic::masterReturn( int send, float v )
|
||||
void Logic::masterInputToActive( int inputTo, bool active)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Logic::masterInputToActive( Event::INPUT_TO inputTo, bool active)
|
||||
{
|
||||
jack->inputToActive( inputTo, active);
|
||||
jack->inputToActive( (Event::INPUT_TO)inputTo, active);
|
||||
jack->getControllerUpdater()->masterInputToActive( (int)inputTo, active );
|
||||
}
|
||||
|
||||
void Logic::trackVolume(int t, float v)
|
||||
|
|
|
@ -29,8 +29,8 @@ class Logic
|
|||
void metronomeEnable(bool b);
|
||||
|
||||
void masterInputVol( float v );
|
||||
void masterInputTo( Event::INPUT_TO inputTo, float v);
|
||||
void masterInputToActive( Event::INPUT_TO inputTo, bool active);
|
||||
void masterInputTo( int inputTo, float v);
|
||||
void masterInputToActive( int inputTo, bool active);
|
||||
|
||||
void masterReturn( int send, float v);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ int DiskWriter::runTests()
|
|||
* disk.
|
||||
**/
|
||||
int waste = 0;
|
||||
GenericMIDI* dummy = new GenericMIDI( waste, "Dummy" );
|
||||
GenericMIDI* dummy = new GenericMIDI( waste, "dummy" );
|
||||
std::string name = "dummy name";
|
||||
std::string author = "dummy author";
|
||||
std::string link = "www.dummylink.com";
|
||||
|
|
Loading…
Add table
Reference in a new issue