Fix unnecessarily type specific code, tidy, fix whitespace.

git-svn-id: svn://localhost/ardour2/branches/3.0@5844 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-10-21 16:56:58 +00:00
parent 86a09c58e3
commit 046f802662
9 changed files with 38 additions and 44 deletions

View File

@ -193,14 +193,9 @@ AddRouteDialog::track ()
ARDOUR::DataType
AddRouteDialog::type ()
{
// FIXME: ew
const string str = channel_combo.get_active_text();
if (str == _("MIDI")) {
return ARDOUR::DataType::MIDI;
} else {
return ARDOUR::DataType::AUDIO;
}
return (channel_combo.get_active_text() == _("MIDI"))
? ARDOUR::DataType::MIDI
: ARDOUR::DataType::AUDIO;
}
string

View File

@ -200,9 +200,9 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
setup_fade_handle_positions ();
if (!trackview.session().config.get_show_region_fades()) {
set_fade_visibility (false);
}
if (!trackview.session().config.get_show_region_fades()) {
set_fade_visibility (false);
}
const string line_name = _region->name() + ":gain";
@ -381,18 +381,18 @@ AudioRegionView::region_resized (Change what_changed)
if (what_changed & Change (StartChanged|LengthChanged)) {
for (uint32_t n = 0; n < waves.size(); ++n) {
waves[n]->property_region_start() = _region->start();
for (uint32_t n = 0; n < waves.size(); ++n) {
waves[n]->property_region_start() = _region->start();
}
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
if((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
for (vector<WaveView*>::iterator w = agr->waves.begin(); w != agr->waves.end(); ++w) {
(*w)->property_region_start() = _region->start();
}
}
}
}
}
}

View File

@ -31,6 +31,7 @@
#include "time_axis_view.h"
#include "audio_time_axis.h"
#include "audio_region_view.h"
#include "midi_region_view.h"
#include "pbd/pthread_utils.h"
#include "ardour/types.h"
@ -116,11 +117,16 @@ int
Editor::write_region_selection (RegionSelection& regions)
{
for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) {
// FIXME
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*i);
if (arv)
if (arv) {
if (write_region ("", arv->audio_region()) == false)
return -1;
}
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
if (mrv) {
warning << "MIDI region export not implemented" << endmsg;
}
}
return 0;

View File

@ -3087,10 +3087,6 @@ Editor::region_fill_track ()
boost::shared_ptr<Region> region ((*i)->region());
// FIXME
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region);
assert(ar);
boost::shared_ptr<Playlist> pl = region->playlist();
if (end <= region->last_frame()) {
@ -3104,7 +3100,7 @@ Editor::region_fill_track ()
}
XMLNode &before = pl->get_state();
pl->add_region (RegionFactory::create (ar), ar->last_frame(), times);
pl->add_region (RegionFactory::create (region), region->last_frame(), times);
session->add_command (new MementoCommand<Playlist>(*pl, &before, &pl->get_state()));
}
@ -3114,7 +3110,7 @@ Editor::region_fill_track ()
void
Editor::region_fill_selection ()
{
if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) {
if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) {
return;
}

View File

@ -617,8 +617,8 @@ EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row co
char fadeout_str[16];
char used_str[8];
int used;
BBT_Time bbt; // FIXME Why do these have to be declared here ?
SMPTE::Time smpte; // FIXME I would like them declared in the case statment where they are used.
BBT_Time bbt;
SMPTE::Time smpte;
bool missing_source = boost::dynamic_pointer_cast<SilentFileSource>(region->source());

View File

@ -185,16 +185,16 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
/* input */
Gtk::ComboBoxText* combo;
std::map<std::string, float>* combo_map;
Gtk::ToggleButton* button;
boost::shared_ptr<AutomationController> controller;
Gtkmm2ext::ClickBox* clickbox;
Gtk::Label label;
bool logarithmic;
bool update_pending;
char ignore_change;
Gtk::Button automate_button;
Gtk::ComboBoxText* combo;
std::map<std::string, float>* combo_map;
Gtk::ToggleButton* button;
boost::shared_ptr<AutomationController> controller;
Gtkmm2ext::ClickBox* clickbox;
Gtk::Label label;
bool logarithmic;
bool update_pending;
char ignore_change;
Gtk::Button automate_button;
/* output */
@ -243,7 +243,7 @@ class PluginUIWindow : public Gtk::Window
void resize_preferred();
void set_parent (Gtk::Window*);
void set_title(const Glib::ustring& title);
void set_title(const Glib::ustring& title);
bool on_enter_notify_event (GdkEventCrossing*);

View File

@ -46,8 +46,8 @@ TempoLines::tempo_map_changed()
for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++d) {
Lines::iterator next = i;
++next;
i->second->property_x1() = - d;
i->second->property_x2() = - d;
i->second->property_x1() = - d;
i->second->property_x2() = - d;
_lines.erase(i);
_lines.insert(make_pair(- d, i->second));
i = next;
@ -58,7 +58,7 @@ void
TempoLines::show ()
{
for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++i) {
i->second->show();
i->second->show();
}
}
@ -66,7 +66,7 @@ void
TempoLines::hide ()
{
for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++i) {
i->second->hide();
i->second->hide();
}
}

View File

@ -124,14 +124,11 @@ MidiTrack::use_diskstream (string name)
{
boost::shared_ptr<MidiDiskstream> dstream;
cerr << "\n\n\nMIDI use diskstream\n";
if ((dstream = boost::dynamic_pointer_cast<MidiDiskstream>(_session.diskstream_by_name (name))) == 0) {
error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), name) << endmsg;
return -1;
}
cerr << "\n\n\nMIDI found DS\n";
return set_diskstream (dstream);
}

View File

@ -893,7 +893,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
bool changed = false;
bool do_not_and_did_not_need_panning = ((nouts < 2) && (outputs.size() < 2));
cout << "Reset panner for " << nouts << " " << npans << "\n";
//cout << "Reset panner for " << nouts << " " << npans << "\n";
/* if new and old config don't need panning, or if
the config hasn't changed, we're done.