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

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

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

revision 1460 by persson, Sat Oct 27 12:28:33 2007 UTC revision 1831 by persson, Tue Feb 3 19:38:19 2009 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006, 2007 Andreas Persson   * Copyright (C) 2006-2009 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 17  Line 17 
17   * 02110-1301 USA.   * 02110-1301 USA.
18   */   */
19    
20    #include <cstring>
21    
22  #include "paramedit.h"  #include "paramedit.h"
23    
24    #include "global.h"
25    
26  namespace {  namespace {
27      const char* const controlChangeTexts[] = {      const char* const controlChangeTexts[] = {
28          "none", "channelaftertouch", "velocity",          _("none"), _("channelaftertouch"), _("velocity"),
29          0,          0,
30          "modwheel", // "Modulation Wheel or Lever",          _("modwheel"), // "Modulation Wheel or Lever",
31          "breath", // "Breath Controller",          _("breath"), // "Breath Controller",
32          0,          0,
33          "foot", // "Foot Controller",          _("foot"), // "Foot Controller",
34          "portamentotime", // "Portamento Time",          _("portamentotime"), // "Portamento Time",
35          0, 0, 0, 0, 0, 0,          0, 0, 0, 0, 0, 0,
36          "effect1", // "Effect Control 1",          _("effect1"), // "Effect Control 1",
37          "effect2", // "Effect Control 2",          _("effect2"), // "Effect Control 2",
38          0, 0,          0, 0,
39          "genpurpose1", // "General Purpose Controller 1",          _("genpurpose1"), // "General Purpose Controller 1",
40          "genpurpose2", // "General Purpose Controller 2",          _("genpurpose2"), // "General Purpose Controller 2",
41          "genpurpose3", // "General Purpose Controller 3",          _("genpurpose3"), // "General Purpose Controller 3",
42          "genpurpose4", // "General Purpose Controller 4",          _("genpurpose4"), // "General Purpose Controller 4",
43          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45          0, 0, 0, 0, 0, 0,          0, 0, 0, 0, 0, 0,
46          "sustainpedal", // "Damper Pedal on/off (Sustain)",          _("sustainpedal"), // "Damper Pedal on/off (Sustain)",
47          "portamento", // "Portamento On/Off",          _("portamento"), // "Portamento On/Off",
48          "sostenuto", // "Sustenuto On/Off",          _("sostenuto"), // "Sustenuto On/Off",
49          "softpedal", // "Soft Pedal On/Off",          _("softpedal"), // "Soft Pedal On/Off",
50          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
51          "genpurpose5", // "General Purpose Controller 5",          _("genpurpose5"), // "General Purpose Controller 5",
52          "genpurpose6", // "General Purpose Controller 6",          _("genpurpose6"), // "General Purpose Controller 6",
53          "genpurpose7", // "General Purpose Controller 7",          _("genpurpose7"), // "General Purpose Controller 7",
54          "genpurpose8", // "General Purpose Controller 8",          _("genpurpose8"), // "General Purpose Controller 8",
55          0, 0, 0, 0, 0, 0, 0,          0, 0, 0, 0, 0, 0, 0,
56          "effect1depth", // "Effects 1 Depth",          _("effect1depth"), // "Effects 1 Depth",
57          "effect2depth", // "Effects 2 Depth",          _("effect2depth"), // "Effects 2 Depth",
58          "effect3depth", // "Effects 3 Depth",          _("effect3depth"), // "Effects 3 Depth",
59          "effect4depth", // "Effects 4 Depth",          _("effect4depth"), // "Effects 4 Depth",
60          "effect5depth", // "Effects 5 Depth"          _("effect5depth"), // "Effects 5 Depth"
61      };      };
62  }  }
63    
# Line 186  NoteEntry::NoteEntry(const char* labelTe Line 190  NoteEntry::NoteEntry(const char* labelTe
190  }  }
191    
192  const char* notes[] = {  const char* notes[] = {
193      "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"      _("C"), _("C#"), _("D"), _("D#"), _("E"), _("F"),_("F#"),
194        _("G"), _("G#"), _("A"), _("A#"), _("B")
195  };  };
196    
197    
# Line 314  BoolEntry::BoolEntry(const char* labelTe Line 319  BoolEntry::BoolEntry(const char* labelTe
319  StringEntry::StringEntry(const char* labelText) :  StringEntry::StringEntry(const char* labelText) :
320      LabelWidget(labelText, entry)      LabelWidget(labelText, entry)
321  {  {
322      entry.signal_changed().connect(      entry.signal_changed().connect(sig_changed.make_slot());
         sigc::mem_fun(*this, &StringEntry::value_changed));  
323  }  }
324    
325  void StringEntry::value_changed()  StringEntryMultiLine::StringEntryMultiLine(const char* labelText) :
326        LabelWidget(labelText, frame)
327  {  {
328      if (ptr) {      text_buffer = text_view.get_buffer();
329          *ptr = entry.get_text();      frame.set_shadow_type(Gtk::SHADOW_IN);
330          sig_changed();      frame.add(text_view);
331      }      text_buffer->signal_changed().connect(sig_changed.make_slot());
332    }
333    
334    gig::String StringEntryMultiLine::get_value() const
335    {
336        Glib::ustring value = text_buffer->get_text();
337        for (int i = 0 ; (i = value.find("\x0a", i)) >= 0 ; i += 2)
338            value.replace(i, 1, "\x0d\x0a");
339        return value;
340  }  }
341    
342  void StringEntry::set_ptr(gig::String* ptr)  void StringEntryMultiLine::set_value(gig::String value)
343  {  {
344      this->ptr = 0;      for (int i = 0 ; (i = value.find("\x0d\x0a", i, 2)) >= 0 ; i++)
345      entry.set_text(*ptr);          value.replace(i, 2, "\x0a");
346      this->ptr = ptr;      text_buffer->set_text(value);
347  }  }

Legend:
Removed from v.1460  
changed lines
  Added in v.1831

  ViewVC Help
Powered by ViewVC