summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour.colors4
-rw-r--r--gtk2_ardour/ardour2_ui.rc12
-rw-r--r--gtk2_ardour/audio_time_axis.cc6
-rw-r--r--gtk2_ardour/color_manager.cc2
-rw-r--r--gtk2_ardour/mixer_strip.cc13
-rw-r--r--gtk2_ardour/time_axis_view.cc4
-rw-r--r--libs/ardour/ardour/buffer.h32
-rw-r--r--libs/ardour/route.cc10
-rw-r--r--libs/ardour/session_state.cc17
9 files changed, 87 insertions, 13 deletions
diff --git a/gtk2_ardour/ardour.colors b/gtk2_ardour/ardour.colors
index 6156014f63..50f9460b3c 100644
--- a/gtk2_ardour/ardour.colors
+++ b/gtk2_ardour/ardour.colors
@@ -1,7 +1,7 @@
cWaveForm 0.0 0.0 0.0 0.80
cMutedWaveForm 0.35 0.35 0.35 1.0
-cSelectedFrameBase 0.71 0.57 0.66 1.0
-cFrameBase 0.75 0.75 0.76 1.0
+cSelectedFrameBase 0.0 0.57 0.66 0.5
+cFrameBase 0.0 0.76 0.75 0.5
cAudioTrackBase 0.75 0.75 0.85 0.41
cAudioTrackOutline 0.00 0.00 0.00 1.00
cAudioBusBase 0.75 0.80 0.75 0.41
diff --git a/gtk2_ardour/ardour2_ui.rc b/gtk2_ardour/ardour2_ui.rc
index 3686a1b0b6..e43013a98e 100644
--- a/gtk2_ardour/ardour2_ui.rc
+++ b/gtk2_ardour/ardour2_ui.rc
@@ -517,7 +517,7 @@ style "audio_bus_base"
font_name = "sans 6"
fg[NORMAL] = { 0.77, 0.77, 0.72 }
fg[NORMAL] = { 0.7, 0.8, 0.2 }
- bg[NORMAL] = {0, 0.36, 0.40 }
+ bg[NORMAL] = {0, 0.40, 0.36 }
}
style "midi_track_base" = "default_base"
@@ -1028,13 +1028,19 @@ widget "*BBTRuler" style "editor_time_ruler"
widget "*FramesRuler" style "editor_time_ruler"
widget "*MinSecRuler" style "editor_time_ruler"
widget "*BaseFrame" style "base_frame"
+widget "*BusControlsBaseUnselected" style "audio_bus_base"
+widget "*AudioTimeAxisViewControlsBaseUnselected" style "audio_track_base"
widget "*AudioTrackStripBase" style "audio_track_base"
-widget "*TimeAxisViewControlsBaseUnselected" style "audio_track_base"
widget "*AudioTrackControlsBaseUnselected" style "audio_track_base"
widget "*AudioTrackFader" style "audio_track_base"
widget "*AudioBusStripBase" style "audio_bus_base"
-widget "*BusControlsBaseUnselected" style "audio_bus_base"
widget "*AudioBusFader" style "audio_bus_base"
+widget "*MidiTimeAxisViewControlsBaseUnselected" style "midi_track_base"
+widget "*MidiTrackStripBase" style "midi_track_base"
+widget "*MidiTrackControlsBaseUnselected" style "midi_track_base"
+widget "*MidiTrackFader" style "midi_track_base"
+widget "*MidiBusStripBase" style "midi_bus_base"
+widget "*MidiBusFader" style "midi_bus_base"
widget "*TrackSeparator" style "track_separator"
widget "*TrackEditIndicator0*" style "edit_group_0"
widget "*TrackEditIndicator1*" style "edit_group_1"
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index f7c9093fe7..1c0b920c13 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -157,6 +157,12 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
visual_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::visual_click));
hide_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::hide_click));
+ // FIXME: hack (pretty colours)
+ if (is_audio_track())
+ controls_ebox.set_name ("AudioTimeAxisViewControlsBaseUnselected");
+ else
+ controls_ebox.set_name ("MidiTimeAxisViewControlsBaseUnselected");
+
if (is_audio_track()) {
controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
}
diff --git a/gtk2_ardour/color_manager.cc b/gtk2_ardour/color_manager.cc
index 2f1a286467..91a12dbf9f 100644
--- a/gtk2_ardour/color_manager.cc
+++ b/gtk2_ardour/color_manager.cc
@@ -79,6 +79,8 @@ ColorManager::load (string path)
return -1;
}
+ cerr << "Loading color definition file " << path << endl;
+
while (in) {
string name;
double r, g, b, a;
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 49622a8dce..997259a875 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -1170,7 +1170,18 @@ MixerStrip::route_active_changed ()
{
RouteUI::route_active_changed ();
- if (is_audio_track()) {
+ // FIXME: MIDI/Audio bus distinction
+
+ if (is_midi_track()) {
+ if (_route.active()) {
+ set_name ("MidiTrackStripBase");
+ gpm.set_meter_strip_name ("MidiTrackStripBase");
+ } else {
+ set_name ("MidiTrackStripBaseInactive");
+ gpm.set_meter_strip_name ("MidiTrackStripBaseInactive");
+ }
+ gpm.set_fader_name ("MidiTrackFader");
+ } else if (is_audio_track()) {
if (_route.active()) {
set_name ("AudioTrackStripBase");
gpm.set_meter_strip_name ("AudioTrackStripBase");
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index b5ab5baa10..fc388a4b2b 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -131,8 +131,8 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
controls_vbox.pack_start (controls_table, false, false);
controls_vbox.show ();
-
- controls_ebox.set_name ("TimeAxisViewControlsBaseUnselected");
+
+ //controls_ebox.set_name ("TimeAxisViewControlsBaseUnselected");
controls_ebox.add (controls_vbox);
controls_ebox.add_events (BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK|SCROLL_MASK);
controls_ebox.set_flags (CAN_FOCUS);
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h
index 5171f50697..f0ad3be67e 100644
--- a/libs/ardour/ardour/buffer.h
+++ b/libs/ardour/ardour/buffer.h
@@ -29,6 +29,10 @@
namespace ARDOUR {
+/* Yes, this is a bit of a mess right now. I'll clean it up when everything
+ * using it works out.. */
+
+
/** A buffer of recordable/playable data.
*
* This is a datatype-agnostic base class for all buffers (there are no
@@ -60,13 +64,17 @@ public:
size_t size() const { return _size; }
/** Type of this buffer.
- * Based on this you can cast a Buffer* to the desired type. */
+ * Based on this you can static cast a Buffer* to the desired type. */
virtual Type type() const { return _type; }
/** Jack type (eg JACK_DEFAULT_AUDIO_TYPE) */
const char* jack_type() const { return type_to_jack_type(type()); }
- /** Separate for creating ports (before a buffer exists to call jack_type on) */
+ /** String type as saved in session XML files (eg "audio" or "midi") */
+ const char* type_string() const { return type_to_string(type()); }
+
+ /* The below static methods need to be separate from the above methods
+ * because the conversion is needed in places where there's no Buffer */
static const char* type_to_jack_type(Type t) {
switch (t) {
case AUDIO: return JACK_DEFAULT_AUDIO_TYPE;
@@ -74,6 +82,24 @@ public:
default: return "";
}
}
+
+ static const char* type_to_string(Type t) {
+ switch (t) {
+ case AUDIO: return "audio";
+ case MIDI: return "midi";
+ default: return "unknown"; // reeeally shouldn't ever happen
+ }
+ }
+
+ /** Used for loading from XML (route default types etc) */
+ static Type type_from_string(const string& str) {
+ if (str == "audio")
+ return AUDIO;
+ else if (str == "midi")
+ return MIDI;
+ else
+ return NIL;
+ }
protected:
Type _type;
@@ -82,7 +108,7 @@ protected:
};
-/* Since we only have two types, templates aren't worth it, yet.. */
+/* Inside every class with a type in it's name is a template waiting to get out... */
/** Buffer containing 32-bit floating point (audio) data. */
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 568bfddfc3..8ad402c66a 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -20,6 +20,7 @@
#include <cmath>
#include <fstream>
+#include <cassert>
#include <sigc++/bind.h>
#include <pbd/xml++.h>
@@ -1346,6 +1347,10 @@ Route::state(bool full_state)
snprintf (buf, sizeof (buf), "0x%x", _flags);
node->add_property("flags", buf);
}
+
+ // FIXME: assumes there's only audio and MIDI types
+ node->add_property("default-type", Buffer::type_to_string(_default_type));
+
node->add_property("active", _active?"yes":"no");
node->add_property("muted", _muted?"yes":"no");
node->add_property("soloed", _soloed?"yes":"no");
@@ -1541,6 +1546,11 @@ Route::set_state (const XMLNode& node)
} else {
_flags = Flag (0);
}
+
+ if ((prop = node.property ("default-type")) != 0) {
+ _default_type = Buffer::type_from_string(prop->value());
+ assert(_default_type != Buffer::NIL);
+ }
if ((prop = node.property ("phase-invert")) != 0) {
set_phase_invert(prop->value()=="yes"?true:false, this);
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 9f21eb5c4e..a8cbd7bd78 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -74,6 +74,7 @@
#include <ardour/slave.h>
#include <ardour/tempo.h>
#include <ardour/audio_track.h>
+#include <ardour/midi_track.h>
#include <ardour/cycle_timer.h>
#include <ardour/utils.h>
#include <ardour/named_selection.h>
@@ -1716,8 +1717,20 @@ Session::XMLRouteFactory (const XMLNode& node)
return 0;
}
- if (node.property ("diskstream") != 0 || node.property ("diskstream-id") != 0) {
- return new AudioTrack (*this, node);
+ bool has_diskstream = (node.property ("diskstream") != 0 || node.property ("diskstream-id") != 0);
+
+ Buffer::Type type = Buffer::AUDIO;
+ const XMLProperty* prop = node.property("default-type");
+ if (prop)
+ type = Buffer::type_from_string(prop->value());
+
+ assert(type != Buffer::NIL);
+
+ if (has_diskstream) {
+ if (type == Buffer::AUDIO)
+ return new AudioTrack (*this, node);
+ else
+ return new MidiTrack (*this, node);
} else {
return new Route (*this, node);
}