* Some Export GUI tweaks

* Export region with fades
* Removed some debug output


git-svn-id: svn://localhost/ardour2/branches/3.0@3923 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sakari Bergen 2008-10-11 14:07:50 +00:00
parent 354790d754
commit 41c892802f
11 changed files with 80 additions and 26 deletions

View File

@ -1191,6 +1191,11 @@ style "ardour_button" ="default_button"
ythickness = 1
}
style "padded_button" = "default_button"
{
xthickness = 8
}
style "odd_port_groups"
{
fg[NORMAL] = { 0.6, 0.6, 0.6 }
@ -1210,18 +1215,11 @@ class "GtkButton" style:highest "ardour_button"
class "GtkArrow" style:highest "tearoff_arrow"
class "GtkProgressBar" style:highest "ardour_progressbars"
widget "PaddedButton" style:highest "padded_button"
widget "*FirstActionMessage" style:highest "first_action_message"
widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor"
widget "*MarkerText" style:highest "marker_text"
widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name"
#widget "*ExportProgress" style:highest "default_generic"
widget "*ExportFileLabel" style:highest "small_bold_text"
widget "*ExportFormatLabel" style:highest "medium_bold_text"
widget "*ExportHeader" style:highest "small_bold_text"
widget "*ExportFileDisplay" style:highest "medium_entry"
widget "*ExportFormatDisplay" style:highest "medium_entry"
widget "*ExportCheckbox" style:highest "small_entry"
widget "*ExportTrackSelector*" style:highest "medium_entry_noselection_bg"
widget "*EditModeSelector" style:highest "medium_bold_entry"
widget "*SnapTypeSelector" style:highest "medium_bold_entry"
widget "*SnapModeSelector" style:highest "medium_bold_entry"

View File

@ -1190,6 +1190,11 @@ style "ardour_button" ="default_button"
ythickness = 1
}
style "padded_button" = "default_button"
{
xthickness = 8
}
style "odd_port_groups"
{
fg[NORMAL] = { 0.6, 0.6, 0.6 }
@ -1209,6 +1214,7 @@ class "GtkButton" style:highest "ardour_button"
class "GtkArrow" style:highest "tearoff_arrow"
class "GtkProgressBar" style:highest "ardour_progressbars"
widget "PaddedButton" style:highest "padded_button"
widget "*FirstActionMessage" style:highest "first_action_message"
widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor"
widget "*MarkerText" style:highest "marker_text"

View File

@ -440,15 +440,20 @@ RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::AudioRegion co
track_chans (track.n_outputs().n_audio()),
raw_button (type_group),
fades_button (type_group),
processed_button (type_group)
{
pack_start (vbox);
raw_button.set_label (string_compose (_("Raw region export, no fades or plugins (%1 channels)"), region_chans));
raw_button.set_label (string_compose (_("Region contents without fades (channels: %1)"), region_chans));
raw_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (raw_button);
processed_button.set_label (string_compose (_("Processed region export with fades and plugins applied (%1 channels)"), track_chans));
fades_button.set_label (string_compose (_("Region contents with fades (channels: %1)"), region_chans));
fades_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (fades_button);
processed_button.set_label (string_compose (_("Track output (channels: %1)"), track_chans));
processed_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (processed_button);
@ -475,21 +480,18 @@ RegionExportChannelSelector::handle_selection ()
state->config->clear_channels ();
if (raw_button.get_active ()) {
factory.reset (new RegionExportChannelFactory (session, region, track, RegionExportChannelFactory::Raw));
for (size_t chan = 0; chan < region_chans; ++chan) {
state->config->register_channel (factory->create (chan));
}
} else if (fades_button.get_active ()) {
factory.reset (new RegionExportChannelFactory (session, region, track, RegionExportChannelFactory::Fades));
} else if (processed_button.get_active ()) {
factory.reset (new RegionExportChannelFactory(session, region, track, RegionExportChannelFactory::Processed));
for (size_t chan = 0; chan < region_chans; ++chan) {
state->config->register_channel (factory->create (chan));
}
} else {
CriticalSelectionChanged ();
return;
}
for (size_t chan = 0; chan < region_chans; ++chan) {
state->config->register_channel (factory->create (chan));
}
CriticalSelectionChanged ();

View File

@ -212,6 +212,7 @@ class RegionExportChannelSelector : public ExportChannelSelector
Gtk::RadioButtonGroup type_group;
Gtk::RadioButton raw_button;
Gtk::RadioButton fades_button;
Gtk::RadioButton processed_button;
};

View File

@ -115,9 +115,11 @@ ExportDialog::init ()
/* Buttons */
cancel_button = add_button (Gtk::Stock::CANCEL, RESPONSE_CANCEL);
rt_export_button = add_button (_("Realtime export"), RESPONSE_RT);
rt_export_button = add_button (_("Realtime Export"), RESPONSE_RT);
fast_export_button = add_button (_("Fast Export"), RESPONSE_FAST);
list_files_button.set_name ("PaddedButton");
cancel_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::close_dialog));
rt_export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::export_rt));
fast_export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::export_fw));

View File

@ -248,6 +248,6 @@ ExportFileNotebook::FilePage::save_format_to_manager (FormatPtr format)
void
ExportFileNotebook::FilePage::update_tab_label ()
{
tab_label.set_text (string_compose ("%1 %2", tab_number, get_format_name()));
tab_label.set_text (string_compose ("Format %1: %2", tab_number, get_format_name()));
CriticalSelectionChanged();
}

View File

@ -56,6 +56,8 @@ ExportFilenameSelector::ExportFilenameSelector () :
path_hbox.pack_start (path_entry, true, true, 3);
path_hbox.pack_start (browse_button, false, false, 3);
browse_button.set_name ("PaddedButton");
label_sizegroup = Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
label_sizegroup->add_widget (label_label);
label_sizegroup->add_widget (path_label);

View File

@ -38,6 +38,10 @@ ExportFormatSelector::ExportFormatSelector () :
pack_start (remove_button, false, false, 3);
pack_start (new_button, false, false, 3);
edit_button.set_name ("PaddedButton");
remove_button.set_name ("PaddedButton");
new_button.set_name ("PaddedButton");
edit_button.signal_clicked().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &ExportFormatSelector::open_edit_dialog), false)));
remove_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::remove_format));
new_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::add_new_format));

View File

@ -40,6 +40,10 @@ ExportPresetSelector::ExportPresetSelector () :
pack_start (remove_button, false, false, 6);
pack_start (new_button, false, false, 0);
save_button.set_name ("PaddedButton");
remove_button.set_name ("PaddedButton");
new_button.set_name ("PaddedButton");
save_button.set_sensitive (false);
remove_button.set_sensitive (false);
new_button.set_sensitive (false);

View File

@ -90,10 +90,12 @@ class RegionExportChannelFactory : public sigc::trackable
public:
enum Type {
Raw,
Fades,
Processed
};
RegionExportChannelFactory (Session * session, AudioRegion const & region, AudioTrack & track, Type type);
~RegionExportChannelFactory ();
ExportChannelPtr create (uint32_t channel);
void read (uint32_t channel, Sample * data, nframes_t frames_to_read);
@ -113,6 +115,9 @@ class RegionExportChannelFactory : public sigc::trackable
bool buffers_up_to_date;
nframes_t region_start;
nframes_t position;
Sample * mixdown_buffer;
Sample * gain_buffer;
};
/// Export channel that reads from region channel

View File

@ -81,11 +81,22 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
frames_per_cycle (session->engine().frames_per_cycle ()),
buffers_up_to_date (false),
region_start (region.position()),
position (region_start)
position (region_start),
mixdown_buffer (0),
gain_buffer (0)
{
switch (type) {
case Raw:
n_channels = region.n_channels();
break;
case Fades:
n_channels = region.n_channels();
mixdown_buffer = new Sample [frames_per_cycle];
gain_buffer = new Sample [frames_per_cycle];
memset (gain_buffer, 1.0, sizeof (Sample) * frames_per_cycle);
break;
case Processed:
n_channels = track.n_outputs().n_audio();
@ -100,6 +111,17 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle);
}
RegionExportChannelFactory::~RegionExportChannelFactory ()
{
if (mixdown_buffer) {
delete[] mixdown_buffer;
}
if (gain_buffer) {
delete[] gain_buffer;
}
}
ExportChannelPtr
RegionExportChannelFactory::create (uint32_t channel)
{
@ -124,14 +146,22 @@ RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t fra
void
RegionExportChannelFactory::update_buffers (nframes_t frames)
{
assert (frames <= frames_per_cycle);
switch (type) {
case Raw:
for (size_t channel = 0; channel < n_channels; ++channel) {
region.read (buffers.get_audio (channel).data(), position - region_start, frames, channel);
}
break;
case Fades:
assert (mixdown_buffer && gain_buffer);
for (size_t channel = 0; channel < n_channels; ++channel) {
memset (mixdown_buffer, 0, sizeof (Sample) * frames);
region.read_at (buffers.get_audio (channel).data(), mixdown_buffer, gain_buffer, position, frames, channel);
}
break;
case Processed:
std::cout << "exporting " << frames << " frames from position " << position << std::endl;
track.export_stuff (buffers, position, frames);
break;
default: