Merged with trunk R1612.
[ardour.git] / gtk2_ardour / editor_region_list.cc
index 5bf704f649851d70c0d9382984eec669387c0aaa..5b1b9c63deb855b86963a5307cf733157857a8b8 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <cstdlib>
 
 #include <ardour/audioregion.h>
 #include <ardour/audiofilesource.h>
+#include <ardour/silentfilesource.h>
 #include <ardour/session_region.h>
 
 #include <gtkmm2ext/stop_signal.h>
 
 #include "editor.h"
 #include "editing.h"
+#include "keyboard.h"
 #include "ardour_ui.h"
 #include "gui_thread.h"
 #include "actions.h"
@@ -85,6 +86,9 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
        string str;
        TreeModel::Row row;
        Gdk::Color c;
+       bool missing_source;
+
+       missing_source = boost::dynamic_pointer_cast<SilentFileSource>(region->source());
 
        if (!show_automatic_regions_in_region_list && region->automatic()) {
                return;
@@ -124,7 +128,11 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
        } else if (region->whole_file()) {
 
                row = *(region_list_model->append());
-               set_color(c, rgba_from_style ("RegionListWholeFile", 0xff, 0, 0, 0, "fg", Gtk::STATE_NORMAL, false ));
+               if (missing_source) {
+                       c.set_rgb(65535,0,0);     // FIXME: error color from style
+               } else {
+                       set_color(c, rgba_from_style ("RegionListWholeFile", 0xff, 0, 0, 0, "fg", Gtk::STATE_NORMAL, false ));
+               }
                row[region_list_columns.color_] = c;
 
                if (region->source()->name()[0] == '/') { // external file
@@ -150,6 +158,10 @@ Editor::add_region_to_region_display (boost::shared_ptr<Region> region)
 
                }
 
+               if (missing_source) {
+                       str += _(" (MISSING)");
+               }
+
                row[region_list_columns.name] = str;
                row[region_list_columns.region] = region;