MCPcopy Create free account
hub / github.com/YCAMInterlab/Duration / guiEvent

Method guiEvent

Duration/src/DurationController.cpp:846–1036  ·  view source on GitHub ↗

--------------------------------------------------------------

Source from the content-addressed store, hash-verified

844
845//--------------------------------------------------------------
846void DurationController::guiEvent(ofxUIEventArgs &e){
847 string name = e.widget->getName();
848 int kind = e.widget->getKind();
849
850 // cout << "name is " << name << " kind is " << kind << endl;
851
852 if(e.widget == stopButton && stopButton->getValue()){
853 if(timeline.getIsPlaying()){
854 timeline.stop();
855 }
856 else{
857 timeline.setCurrentTimeMillis(0);
858 }
859 }
860 else if(name == "PLAYPAUSE"){
861 if(!timeline.getIsPlaying()){
862 startPlayback();
863 }
864 else{
865 timeline.stop();
866 }
867 }
868 else if(name == "DURATION"){
869 if(!gui->hasKeyboardFocus()){
870 string newDuration = durationLabel->getTextString();
871 timeline.setDurationInTimecode(newDuration);
872 durationLabel->setTextString(timeline.getDurationInTimecode());
873 needsSave = true;
874 }
875 }
876 else if(e.widget == addTrackDropDown){
877 if(addTrackDropDown->isOpen()){
878 timeline.disable();
879 }
880 else {
881 timeline.enable();
882 if(addTrackDropDown->getSelected().size() > 0){
883 lock();
884 string selectedTrackType = addTrackDropDown->getSelected()[0]->getName();
885 addTrack(translation.keyForTranslation(selectedTrackType));
886 unlock();
887
888 addTrackDropDown->clearSelected();
889 }
890 }
891 }
892 else if(e.widget == projectDropDown){
893 if(projectDropDown->isOpen()){
894 timeline.disable();
895 addTrackDropDown->setVisible(false);
896 }
897 else {
898 addTrackDropDown->setVisible(true);
899 addTrackDropDown->close();
900 timeline.enable();
901 if(projectDropDown->getSelected().size() > 0){
902 string selectedProjectName = projectDropDown->getSelected()[0]->getName();
903 if(selectedProjectName == translation.translateKey("new project...")){

Callers

nothing calls this directly

Calls 1

setupMethod · 0.45

Tested by

no test coverage detected