/[svn]/gigedit/trunk/src/gigedit/gigedit.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/gigedit.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1456 by persson, Sun Oct 21 15:32:36 2007 UTC revision 1656 by schoenebeck, Sat Feb 2 08:18:19 2008 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2007 Andreas Persson   * Copyright (C) 2007, 2008 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 20  Line 20 
20  #include "gigedit.h"  #include "gigedit.h"
21    
22  #include <gtkmm/main.h>  #include <gtkmm/main.h>
23    #include <glibmm/main.h>
24  #include "mainwindow.h"  #include "mainwindow.h"
25    
26  #include "global.h"  #include "global.h"
# Line 39  public: Line 40  public:
40      GigEditState(GigEdit* parent) : parent(parent) { }      GigEditState(GigEdit* parent) : parent(parent) { }
41      void run(gig::Instrument* pInstrument);      void run(gig::Instrument* pInstrument);
42    
43        MainWindow* window;
44    
45  private:  private:
46    
47      // simple condition variable abstraction      // simple condition variable abstraction
# Line 71  private: Line 74  private:
74      Cond open;      Cond open;
75      Cond close;      Cond close;
76      gig::Instrument* instrument;      gig::Instrument* instrument;
     MainWindow* window;  
77    
78      void open_window();      void open_window();
79      void close_window();      void close_window();
# Line 130  void connect_signals(GigEdit* gigedit, M Line 132  void connect_signals(GigEdit* gigedit, M
132      );      );
133  }  }
134    
135  }  } // namespace
136    
137    GigEdit::GigEdit() {
138        state = NULL;
139    }
140    
141  int GigEdit::run(int argc, char* argv[]) {  int GigEdit::run(int argc, char* argv[]) {
142      init_app();      init_app();
# Line 148  int GigEdit::run(gig::Instrument* pInstr Line 153  int GigEdit::run(gig::Instrument* pInstr
153      init_app();      init_app();
154    
155      GigEditState state(this);      GigEditState state(this);
156        this->state = &state;
157      state.run(pInstrument);      state.run(pInstrument);
158        this->state = NULL;
159      return 0;      return 0;
160  }  }
161    
162    void GigEdit::on_note_on_event(int key, int velocity) {
163        if (!this->state) return;
164        GigEditState* state = (GigEditState*) this->state;
165        state->window->signal_note_on().emit(key, velocity);
166    }
167    
168    void GigEdit::on_note_off_event(int key, int velocity) {
169        if (!this->state) return;
170        GigEditState* state = (GigEditState*) this->state;
171        state->window->signal_note_off().emit(key, velocity);
172    }
173    
174  sigc::signal<void, gig::File*>& GigEdit::signal_file_structure_to_be_changed() {  sigc::signal<void, gig::File*>& GigEdit::signal_file_structure_to_be_changed() {
175      return file_structure_to_be_changed_signal;      return file_structure_to_be_changed_signal;
176  }  }

Legend:
Removed from v.1456  
changed lines
  Added in v.1656

  ViewVC Help
Powered by ViewVC