/[svn]/gigedit/trunk/src/gigedit/scriptslots.h
ViewVC logotype

Contents of /gigedit/trunk/src/gigedit/scriptslots.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3197 - (show annotations) (download) (as text)
Sat May 20 17:15:36 2017 UTC (6 years, 10 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2231 byte(s)
* Instruments list view: show amount of real-time instruments scripts used
  by instrument.
* Bumped version (1.0.0.svn49).

1 /*
2 Copyright (c) 2014 - 2017 Christian Schoenebeck
3
4 This file is part of "gigedit" and released under the terms of the
5 GNU General Public License version 2.
6 */
7
8 #ifndef GIGEDIT_SCRIPTSLOTS_H
9 #define GIGEDIT_SCRIPTSLOTS_H
10
11 #ifdef LIBGIG_HEADER_FILE
12 # include LIBGIG_HEADER_FILE(gig.h)
13 #else
14 # include <gig.h>
15 #endif
16
17 #include <gtkmm.h>
18 #include "compat.h"
19 #include <vector>
20 #include "Settings.h"
21 #include "ManagedWindow.h"
22
23 class ScriptSlots : public ManagedWindow {
24 public:
25 ScriptSlots();
26 ~ScriptSlots();
27 void setInstrument(gig::Instrument* instrument);
28
29 sigc::signal<void, gig::Instrument*>& signal_script_slots_changed();
30
31 // implementation for abstract methods of interface class "ManagedWindow"
32 virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->scriptSlotsWindowX; }
33 virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->scriptSlotsWindowY; }
34 virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->scriptSlotsWindowW; }
35 virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->scriptSlotsWindowH; }
36
37 protected:
38 struct Row {
39 int id;
40 Gtk::HBox* hbox;
41 Gtk::Label* label;
42 Gtk::Button* upButton;
43 Gtk::Button* downButton;
44 Gtk::Button* deleteButton;
45 gig::Script* script;
46 };
47
48 sigc::signal<void, gig::Instrument*> script_slots_changed_signal;
49
50 Gtk::VBox m_vbox;
51 Gtk::Label m_generalInfoLabel;
52 Gtk::HButtonBox m_buttonBox;
53 Gtk::ScrolledWindow m_scrolledWindow;
54 Gtk::VBox m_vboxSlots;
55 Gtk::Label m_dragHintLabel;
56 Gtk::Button m_closeButton;
57
58 gig::Instrument* m_instrument;
59 std::vector<Row> m_slots;
60
61 void onScriptDragNDropDataReceived(
62 const Glib::RefPtr<Gdk::DragContext>& context, int, int,
63 const Gtk::SelectionData& selection_data, guint, guint time);
64 void appendNewSlot(gig::Script* script);
65 void moveSlotUp(int slotID);
66 void moveSlotDown(int slotID);
67 void deleteSlot(int slotID);
68 void refreshSlots();
69 void onButtonClose();
70 void onWindowHide();
71 void clearSlots();
72 };
73
74 #endif // GIGEDIT_SCRIPTSLOTS_H

  ViewVC Help
Powered by ViewVC