Progressing Tracks Open Session Dialog

Progressing Preferences panel and UI

[git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 455902]
This commit is contained in:
Valeriy Kamyshniy 2014-04-29 01:07:37 -05:00
parent a7140d7049
commit 41871c3a5d
11 changed files with 272 additions and 377 deletions

View file

@ -2644,7 +2644,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
}
}
SessionDialog session_dialog (should_be_new, session_name, session_path, load_template, cancel_not_quit);
SessionDialog session_dialog (tracks_control_panel, should_be_new, session_name, session_path, load_template, cancel_not_quit);
while (ret != 0) {

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Valeriy Kamyshniy
Copyright (C) 2014 Waves Audio Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -21,33 +21,33 @@
#include "gtk2ardour-config.h"
#endif
#include <fstream>
#include <algorithm>
#include "waves_button.h"
#include <gtkmm/filechooser.h>
#include "pbd/failed_constructor.h"
#include "pbd/file_utils.h"
#include "pbd/replace_all.h"
#include "pbd/whitespace.h"
#include "pbd/stacktrace.h"
#include "pbd/openuri.h"
#include "ardour/audioengine.h"
#include "ardour/filesystem_paths.h"
#include "ardour/recent_sessions.h"
#include "ardour/session.h"
#include "ardour/session_state_utils.h"
#include "ardour/template_utils.h"
#include "ardour/filename_extensions.h"
#include "ardour_ui.h"
//#include <fstream>
//#include <algorithm>
//
//#include "waves_button.h"
//
//#include <gtkmm/filechooser.h>
//
//#include "pbd/failed_constructor.h"
//#include "pbd/file_utils.h"
//#include "pbd/replace_all.h"
//#include "pbd/whitespace.h"
//#include "pbd/stacktrace.h"
//#include "pbd/openuri.h"
//
//#include "ardour/audioengine.h"
//#include "ardour/filesystem_paths.h"
//#include "ardour/recent_sessions.h"
//#include "ardour/session.h"
//#include "ardour/session_state_utils.h"
//#include "ardour/template_utils.h"
//#include "ardour/filename_extensions.h"
//
//#include "ardour_ui.h"
#include "session_dialog.h"
#include "opts.h"
//#include "opts.h"
#include "i18n.h"
#include "utils.h"
//#include "utils.h"
using namespace std;
using namespace Gtk;
@ -58,16 +58,16 @@ using namespace ARDOUR;
#define dbg_msg(a) MessageDialog (a, PROGRAM_NAME).run();
static string poor_mans_glob (string path)
{
string copy = path;
replace_all (copy, "~", Glib::get_home_dir());
return copy;
}
SessionDialog::SessionDialog (bool require_new, const std::string& session_name, const std::string& session_path, const std::string& template_name, bool cancel_not_quit)
SessionDialog::SessionDialog (WM::Proxy<TracksControlPanel>& system_configuration_dialog,
bool require_new,
const std::string& session_name,
const std::string& session_path,
const std::string& template_name,
bool cancel_not_quit)
: WavesDialog (_("session_dialog.xml"), true, false)
, quit_button (get_waves_button ("quit_button"))
, system_configuration_button (get_waves_button ("system_configuration_button"))
, new_session_button (get_waves_button ("new_session_button"))
, open_selected_button (get_waves_button ("open_selected_button"))
, open_saved_session_button (get_waves_button ("open_saved_session_button"))
@ -76,6 +76,7 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name,
, _provided_session_name (session_name)
, _provided_session_path (session_path)
, _existing_session_chooser_used (false)
, _system_configuration_dialog(system_configuration_dialog)
{
recent_session_button[0] = &get_waves_button ("recent_session_button_0");
recent_session_button[1] = &get_waves_button ("recent_session_button_1");
@ -87,239 +88,10 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name,
recent_session_button[7] = &get_waves_button ("recent_session_button_7");
recent_session_button[8] = &get_waves_button ("recent_session_button_8");
recent_session_button[9] = &get_waves_button ("recent_session_button_9");
set_keep_above (true);
set_position (WIN_POS_CENTER);
open_selected_button.set_sensitive (false);
if (!session_name.empty() && !require_new) {
response (RESPONSE_OK);
return;
}
open_selected_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_open_selected));
open_saved_session_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_open_saved_session));
quit_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_quit));
new_session_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_new_session));
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session ));
}
redisplay_recent_sessions();
init();
}
SessionDialog::~SessionDialog()
{
}
void
SessionDialog::clear_given ()
{
_provided_session_path = "";
_provided_session_name = "";
}
std::string
SessionDialog::session_name (bool& should_be_new)
{
should_be_new = false;
if (!_provided_session_name.empty() && !new_only) {
return _provided_session_name;
}
/* Try recent session selection */
if (!selected_session_full_name.empty()) {
should_be_new = (_selection_type == NewSession);
return should_be_new ? Glib::path_get_basename(selected_session_full_name) :
selected_session_full_name;
}
return "";
}
std::string
SessionDialog::session_folder ()
{
if (!selected_session_full_name.empty() ) {
if (Glib::file_test (selected_session_full_name, Glib::FILE_TEST_IS_REGULAR)) {
return Glib::path_get_dirname (selected_session_full_name);
}
return selected_session_full_name;
}
return "";
}
void
SessionDialog::session_selected ()
{
}
void
SessionDialog::on_new_session (WavesButton*)
{
Gtk::FileChooserDialog dialog(*this, _("Create New Session"), Gtk::FILE_CHOOSER_ACTION_SAVE);
dialog.add_button("CANCEL", Gtk::RESPONSE_CANCEL);
dialog.add_button("OK", Gtk::RESPONSE_OK);
if (dialog.run() == Gtk::RESPONSE_OK) {
selected_session_full_name = dialog.get_filename();
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->set_active(false);
}
hide();
_selection_type = NewSession;
response (Gtk::RESPONSE_ACCEPT);
}
}
int
SessionDialog::redisplay_recent_sessions ()
{
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->set_sensitive(false);
}
std::vector<std::string> session_directories;
RecentSessionsSorter cmp;
ARDOUR::RecentSessions rs;
ARDOUR::read_recent_sessions (rs);
if (rs.empty()) {
return 0;
}
// sort them alphabetically
// sort (rs.begin(), rs.end(), cmp);
for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
session_directories.push_back ((*i).second);
}
int session_snapshot_count = 0;
for (vector<std::string>::const_iterator i = session_directories.begin();
(session_snapshot_count < MAX_RECENT_SESSION_COUNTS) && (i != session_directories.end());
++i)
{
std::vector<std::string> state_file_paths;
// now get available states for this session
get_state_files_in_directory (*i, state_file_paths);
vector<string*>* states;
vector<const gchar*> item;
string dirname = *i;
/* remove any trailing / */
if (dirname[dirname.length()-1] == '/') {
dirname = dirname.substr (0, dirname.length()-1);
}
/* check whether session still exists */
if (!Glib::file_test(dirname.c_str(), Glib::FILE_TEST_EXISTS)) {
/* session doesn't exist */
continue;
}
/* now get available states for this session */
if ((states = Session::possible_states (dirname)) == 0) {
/* no state file? */
continue;
}
std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths));
if (state_file_names.empty()) {
continue;
}
recent_session_full_name[session_snapshot_count] = Glib::build_filename (dirname, state_file_names.front() + statefile_suffix);
recent_session_button[session_snapshot_count]->set_text(Glib::path_get_basename (dirname));
recent_session_button[session_snapshot_count]->set_sensitive(true);
ARDOUR_UI::instance()->set_tip(*recent_session_button[session_snapshot_count], recent_session_full_name[session_snapshot_count]);
++session_snapshot_count;
}
return session_snapshot_count;
}
bool
SessionDialog::on_delete_event (GdkEventAny* ev)
{
response (RESPONSE_CANCEL);
return WavesDialog::on_delete_event (ev);
}
//app logic
void
SessionDialog::on_quit (WavesButton*)
{
hide();
response (Gtk::RESPONSE_CANCEL);
}
void
SessionDialog::on_open_selected (WavesButton*)
{
hide();
response (Gtk::RESPONSE_ACCEPT);
}
void
SessionDialog::on_open_saved_session (WavesButton*)
{
Gtk::FileChooserDialog dialog(*this, _("Select Saved Session"));
dialog.add_button("CANCEL", Gtk::RESPONSE_CANCEL);
dialog.add_button("OK", Gtk::RESPONSE_OK);
if (dialog.run() == Gtk::RESPONSE_OK) {
selected_session_full_name = dialog.get_filename();
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
recent_session_button[i]->set_active(false);
}
_selection_type = SavedSession;
hide();
response (Gtk::RESPONSE_ACCEPT);
}
}
void
SessionDialog::on_recent_session (WavesButton* clicked_button)
{
if (clicked_button->get_active()) {
return;
}
else {
selected_session_full_name = "";
_selection_type = Nothing;
for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) {
if (recent_session_button[i] == clicked_button) {
selected_session_full_name = recent_session_full_name[i];
recent_session_button[i]->set_active(true);
} else {
recent_session_button[i]->set_active(false);
_selection_type = RecentSession;
}
}
}
if (_selection_type == RecentSession) {
open_selected_button.set_sensitive (true);
float sr;
SampleFormat sf;
if (Session::get_info_from_path (selected_session_full_name, sr, sf) == 0) {
std::string sample_format(sf == FormatFloat ? _("32 bit float") :
(sf == FormatInt24 ? _("24 bit") :
(sf == FormatInt16 ? _("16 bit") :
"??")));
session_details_label.set_text(string_compose (_("<TBI>\n<TBI>\n<TBI>\n%1\n%2"), sr, sample_format));
}
} else {
open_selected_button.set_sensitive (false);
}
}

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Valeriy Kamyshniy
Copyright (C) 2014 Waves Audio Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -43,86 +43,34 @@
#include "ardour/utils.h"
#include "ardour_dialog.h"
#include "window_manager.h"
class TracksControlPanel;
class EngineControl;
#define MAX_RECENT_SESSION_COUNTS 10
class SessionDialog : public WavesDialog {
public:
SessionDialog (bool require_new, const std::string& session_name, const std::string& session_path,
const std::string& template_name, bool cancel_not_quit);
SessionDialog (WM::Proxy<TracksControlPanel>& system_configuration_dialog,
bool require_new,
const std::string& session_name,
const std::string& session_path,
const std::string& template_name,
bool cancel_not_quit);
~SessionDialog ();
void clear_given ();
std::string session_name (bool& should_be_new);
std::string session_folder ();
bool use_session_template() { return false; }
std::string session_template_name() { return ""; }
// advanced session options
bool create_master_bus() const { return true; }
int master_channel_count() const { return 2; }
bool connect_inputs() const { return true; }
bool limit_inputs_used_for_connection() const { return false; }
int input_limit_count() const { return 0; }
bool connect_outputs() const { return true; }
bool limit_outputs_used_for_connection() const { return false; }
int output_limit_count() const { return 0; }
bool connect_outs_to_master() const { return true; }
bool connect_outs_to_physical() const { return false; }
private:
WavesButton& quit_button;
WavesButton& new_session_button;
WavesButton& open_selected_button;
WavesButton& open_saved_session_button;
WavesButton& system_configuration_button;
WavesButton* recent_session_button[MAX_RECENT_SESSION_COUNTS];
Gtk::Label& session_details_label;
private: //app logic
void on_quit (WavesButton*);
void on_open_selected (WavesButton*);
void on_open_saved_session (WavesButton*);
void on_new_session (WavesButton*);
void on_recent_session (WavesButton*);
enum SessionSelectionType {
Nothing,
RecentSession,
SavedSession,
NewSession
} _selection_type;
std::string recent_session_full_name[MAX_RECENT_SESSION_COUNTS];
std::string selected_session_full_name;
private:
bool new_only;
std::string _provided_session_name;
std::string _provided_session_path;
bool on_delete_event (GdkEventAny*);
struct RecentSessionsSorter {
bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
return cmp_nocase(a.first, b.first) == -1;
}
};
int redisplay_recent_sessions ();
void session_selected ();
bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used
Gtk::Label info_scroller_label;
std::string::size_type info_scroller_count;
bool info_scroller_update();
sigc::connection info_scroller_connection;
WM::Proxy<TracksControlPanel>& _system_configuration_dialog;
#include "session_dialog.logic.h"
};
#endif /* __gtk2_ardour_session_dialog_h__ */

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Paul Davis
Copyright (C) 2014 Waves Audio Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Paul Davis
Copyright (C) 2014 Waves Audio Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Paul Davis
Copyright (C) 2014 Waves Audio Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -540,7 +540,7 @@ TracksControlPanel::set_state (const XMLNode& root)
}
float
TracksControlPanel::get_rate () const
TracksControlPanel::get_sample_rate () const
{
float r = atof (sample_rate_combo.get_active_text ());
/* the string may have been translated with an abbreviation for
@ -562,7 +562,7 @@ uint32_t TracksControlPanel::get_buffer_size() const
void
TracksControlPanel::show_buffer_duration ()
{
float latency = (get_buffer_size() * 1000.0) / get_rate();
float latency = (get_buffer_size() * 1000.0) / get_sample_rate();
char buf[256];
snprintf (buf, sizeof (buf), _("INPUT LATENCY: %.1f MS OUTPUT LATENCY: %.1f MS TOTAL LATENCY: %.1f MS"),
@ -591,8 +591,8 @@ TracksControlPanel::push_state_to_backend (bool start)
return -1;
}
if (backend->set_sample_rate (get_rate())) {
error << string_compose (_("Cannot set sample rate to %1"), get_rate()) << endmsg;
if (backend->set_sample_rate (get_sample_rate())) {
error << string_compose (_("Cannot set sample rate to %1"), get_sample_rate()) << endmsg;
return -1;
}

View file

@ -1,3 +1,21 @@
/*
Copyright (C) 2014 Waves Audio Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// class TracksControlPanel : public WavesDialog {
public:
@ -8,29 +26,32 @@
void update_device_list ();
void switch_to_device(const std::string& device_name);
float get_sample_rate() const;
std::string get_device_name() const { return device_combo.get_active_text (); };
private:
// data types:
struct State {
std::string backend;
std::string driver;
std::string device;
float sample_rate;
uint32_t buffer_size;
uint32_t input_latency;
uint32_t output_latency;
uint32_t input_channels;
uint32_t output_channels;
bool active;
std::string midi_option;
State()
: input_latency (0)
, output_latency (0)
, input_channels (0)
, output_channels (0)
, active (false) {}
std::string backend;
std::string driver;
std::string device;
float sample_rate;
uint32_t buffer_size;
uint32_t input_latency;
uint32_t output_latency;
uint32_t input_channels;
uint32_t output_channels;
bool active;
std::string midi_option;
State()
: input_latency (0)
, output_latency (0)
, input_channels (0)
, output_channels (0)
, active (false) {}
};
typedef std::list<State> StateList;
// attributes
@ -76,8 +97,6 @@
void set_state (const XMLNode&);
int push_state_to_backend (bool start);
float get_rate() const;
std::string get_device_name() const { return device_combo.get_active_text (); };
uint32_t get_buffer_size() const;
uint32_t get_input_channels() const { return 0; };
uint32_t get_output_channels() const { return 0; };

View file

@ -59,8 +59,7 @@
<Label style="generic_control" text="BUFFER SIZE" x="231" y="47"/>
<ComboBoxText style="generic_control" id="buffer_size_combo" x="311" y="42" width="90" height="20" />
<Button
id="control_panel_button"
<Button id="control_panel_button"
style="generic_button"
text="DEVICE\nCONTROL\nPANEL"
x="407" y="12" width="84" height="48"/>
@ -69,8 +68,7 @@
</Layout>
<Layout bgnormal="#565656" x="0" y="101" width="505" height="39">
<Label style="generic_control" text="CHANNEL CONFIGURATION MODE" fgnormal="#ffffff" font="Arial Bold 10" x="17" y="15"/>
<Button
id="multi_out_button"
<Button id="multi_out_button"
style="generic_button"
text="MULTI OUT"
fgnormal="#C2C2C2"
@ -79,8 +77,7 @@
fghover="#CECECE"
font="Arial Bold 10"
x="280" y="6" width="106" height="28"/>
<Button
id="stereo_out_button"
<Button id="stereo_out_button"
text="STEREO OUT"
style="generic_button"
fgnormal="#C2C2C2"
@ -95,12 +92,148 @@
<Layout bgnormal="#862579" x="22" y="13" width="265" height="19">
<Label style="generic_control" text="INPUTS" fgnormal="#ffffff" font ="Arial Bold 10" x="7" y="3"/>
</Layout>
<Layout bgnormal="#862579" x="16" y="62" width="3" height="299"/>
<Layout bgnormal="#797979" x="22" y="35" width="85" height="19">
<Label style="generic_control" text="Port" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Button id="all_inputs_on_button"
text="ALL"
style="generic_control"
fgnormal="#D1D1D1"
bgnormal="#606060"
fgactive="#C9C9C9"
bgactive="#454545"
fghover="#DADADA"
bghover="#808080"
borderwidth="0 0 0 0"
x="111" y="35" width="29" height="19"/>
<Button id="all_inputs_off_button"
text="ALL"
style="generic_control"
fgnormal="#D1D1D1"
bgnormal="#606060"
fgactive="#C9C9C9"
bgactive="#454545"
fghover="#DADADA"
bghover="#808080"
borderwidth="0 0 0 0"
x="141" y="35" width="29" height="19"/>
<Layout bgnormal="#797979" x="174" y="35" width="26" height="19">
<Label style="generic_control" text="#" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Layout bgnormal="#797979" x="202" y="35" width="85" height="19">
<Label style="generic_control" text="Track Name" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Layout bgnormal="#27ae36" x="290" y="13" width="3" height="41"/>
<Layout bgnormal="#27ae36" x="296" y="13" width="179" height="19">
<Label style="generic_control" text="OUTPUTS" fgnormal="#ffffff" font ="Arial Bold 10" x="7" y="3"/>
</Layout>
<Layout bgnormal="#27ae36" x="290" y="62" width="3" height="299"/>
<Layout bgnormal="#797979" x="296" y="35" width="85" height="19">
<Label style="generic_control" text="Port" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Button id="all_outputs_on_button"
text="ALL"
style="generic_control"
fgnormal="#D1D1D1"
bgnormal="#606060"
fgactive="#C9C9C9"
bgactive="#454545"
fghover="#DADADA"
bghover="#808080"
borderwidth="0 0 0 0"
x="385" y="35" width="29" height="19"/>
<Button id="all_outputs_off_button"
text="ALL"
style="generic_control"
fgnormal="#D1D1D1"
bgnormal="#606060"
fgactive="#C9C9C9"
bgactive="#454545"
fghover="#DADADA"
bghover="#808080"
borderwidth="0 0 0 0"
x="415" y="35" width="29" height="19"/>
<Layout bgnormal="#797979" x="448" y="35" width="26" height="19">
<Label style="generic_control" text="#" fgnormal="#000000" x="7" y="3"/>
</Layout>
<ScrolledWindow x="14" y="62" width="480" height="299">
<HBox>
<VBox>
<Layout bgnormal="#565656" width="274" height="20">
<Layout bgnormal="#862579" x="0" y="0" width="3" height="19"/>
<Layout bgnormal="#797979" x="6" y="0" width="85" height="19">
<Label style="generic_control" text="In 1" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Button id="input_on_button"
text="ON"
style="generic_control"
fgnormal="#FFFFFF"
bgnormal="#606060"
fgactive="#FFFFFF"
bgactive="#1CA3B3"
fghover="#FFFFFF"
bghover="#808080"
borderwidth="0 0 0 0"
x="95" y="0" width="29" height="19"/>
<Button id="input_off_button"
text="OFF"
style="generic_control"
fgnormal="#FFFFFF"
bgnormal="#606060"
fgactive="#FFFFFF"
bgactive="#FC3334"
fghover="#FFFFFF"
bghover="#808080"
borderwidth="0 0 0 0"
x="125" y="0" width="29" height="19"/>
<Layout bgnormal="#797979" x="158" y="0" width="26" height="19">
<Label style="generic_control" text="1" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Layout bgnormal="#797979" x="186" y="0" width="85" height="19">
<Label style="generic_control" text="Track Name" fgnormal="#000000" x="7" y="3"/>
</Layout>
</Layout>
</VBox>
<VBox>
<Layout bgnormal="#565656" width="200" height="20">
<Layout bgnormal="#27ae36" x="0" y="0" width="3" height="19"/>
<Layout bgnormal="#797979" x="6" y="0" width="85" height="19">
<Label style="generic_control" text="Out 1" fgnormal="#000000" x="7" y="3"/>
</Layout>
<Button id="output_on_button"
text="ON"
style="generic_control"
fgnormal="#FFFFFF"
bgnormal="#606060"
fgactive="#FFFFFF"
bgactive="#1CA3B3"
fghover="#FFFFFF"
bghover="#808080"
borderwidth="0 0 0 0"
x="95" y="0" width="29" height="19"/>
<Button id="output_off_button"
text="OFF"
style="generic_control"
fgnormal="#FFFFFF"
bgnormal="#606060"
fgactive="#FFFFFF"
bgactive="#FC3334"
fghover="#FFFFFF"
bghover="#808080"
borderwidth="0 0 0 0"
x="125" y="0" width="29" height="19"/>
<Layout bgnormal="#797979" x="158" y="0" width="26" height="19">
<Label style="generic_control" text="1" fgnormal="#000000" x="7" y="3"/>
</Layout>
</Layout>
</VBox>
</HBox>
</ScrolledWindow>
<!--VBox x="14" y="62">
<Layout bgnormal="#565656" width="475" height="800">
<Layout bgnormal="#862579" x="0" y="0" width="3" height="299"/>
<Layout bgnormal="#27ae36" x="274" y="0" width="3" height="299"/>
</Layout>
</VBox-->
<Button
id="name_track_after_driver_button"
text="NAME TRACK\nAFTER DRIVER"
@ -158,14 +291,14 @@
Igor! Add feel free to add what you need here!
-->
<Label style="generic_control" text="FILE TYPE" x="24" y="40"/>
<ComboBoxText style="generic_control" id="file_type_combo" x="215" y="40" width="90" height="20" />
<Label style="generic_control" text="BIT DEPTH" x="24" y="70"/>
<ComboBoxText style="generic_control" id="bit_depth_combo" x="215" y="70" width="90" height="20" />
<Label style="generic_control" text="SESSION FRAME RATE" x="24" y="100"/>
<ComboBoxText style="generic_control" id="frame_rate_combo" x="215" y="100" width="90" height="20" />
<Label style="generic_control" text="AUTO LOCK TIMER" x="24" y="175"/>
<ComboBoxText style="generic_control" id="auto_lock_timer_combo" x="215" y="175" width="90" height="20" />
<Label style="generic_control" text="FILE TYPE" x="24" y="40"/>
<ComboBoxText style="generic_control" id="file_type_combo" x="215" y="40" width="90" height="20" />
<Label style="generic_control" text="BIT DEPTH" x="24" y="70"/>
<ComboBoxText style="generic_control" id="bit_depth_combo" x="215" y="70" width="90" height="20" />
<Label style="generic_control" text="SESSION FRAME RATE" x="24" y="100"/>
<ComboBoxText style="generic_control" id="frame_rate_combo" x="215" y="100" width="90" height="20" />
<Label style="generic_control" text="AUTO LOCK TIMER" x="24" y="175"/>
<ComboBoxText style="generic_control" id="auto_lock_timer_combo" x="215" y="175" width="90" height="20" />
</Layout>
</Layout>
</Dialog>

View file

@ -45,7 +45,13 @@ WavesUI::create_widget (const XMLNode& definition, const XMLNodeMap& styles, std
child = manage (new Gtk::Layout);
} else if (widget_type == "CANVAS") {
std::map<std::string, ArdourCanvas::Item*> named_items;
child = new ArdourCanvas::GtkCanvas(definition, styles, named_items);
child = manage (new ArdourCanvas::GtkCanvas(definition, styles, named_items));
} else if (widget_type == "SCROLLEDWINDOW") {
child = manage (new Gtk::ScrolledWindow);
} else if (widget_type == "VBOX") {
child = manage (new Gtk::VBox);
} else if (widget_type == "HBOX") {
child = manage (new Gtk::HBox);
}
if (child != NULL) {
@ -125,6 +131,19 @@ WavesUI::add_widget (Gtk::Box& parent, const XMLNode& definition, const XMLNodeM
}
Gtk::Widget*
WavesUI::add_widget (Gtk::ScrolledWindow& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets)
{
Gtk::Widget* child = create_widget(definition, styles, named_widgets);
if (child != NULL)
{
parent.add(*child);
}
return child;
}
Gtk::Widget*
WavesUI::add_widget (Gtk::Layout& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets)
{
@ -146,9 +165,10 @@ WavesUI::add_widget (Gtk::Widget& parent, const XMLNode &definition, const XMLNo
Gtk::Widget* child = NULL;
if(dynamic_cast<Gtk::Layout*> (&parent)) {
child = WavesUI::add_widget (*dynamic_cast<Gtk::Layout*> (&parent), definition, styles, named_widgets);
}
else if(dynamic_cast<Gtk::Box*> (&parent)) {
} else if(dynamic_cast<Gtk::Box*> (&parent)) {
child = WavesUI::add_widget (*dynamic_cast<Gtk::Box*> (&parent), definition, styles, named_widgets);
} else if(dynamic_cast<Gtk::ScrolledWindow*> (&parent)) {
child = WavesUI::add_widget (*dynamic_cast<Gtk::ScrolledWindow*> (&parent), definition, styles, named_widgets);
}
if (child != NULL) {

View file

@ -26,6 +26,7 @@
#include "gtkmm/box.h"
#include "gtkmm/layout.h"
#include "gtkmm/label.h"
#include "gtkmm/scrolledwindow.h"
#include "canvas/xml_ui.h"
using namespace ArdourCanvas::XMLUI;
@ -35,6 +36,7 @@ namespace WavesUI {
void create_ui (const XMLNodeList& definition, const XMLNodeMap& styles, Gtk::Widget& root, std::map<std::string, Gtk::Widget*> &named_widgets);
Gtk::Widget* create_widget (const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets);
Gtk::Widget* add_widget (Gtk::Box& parent, const XMLNode &definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets);
Gtk::Widget* add_widget (Gtk::ScrolledWindow& parent, const XMLNode &definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets);
Gtk::Widget* add_widget (Gtk::Layout& parent, const XMLNode &definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets);
Gtk::Widget* add_widget (Gtk::Widget& parent, const XMLNode &definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*> &named_widgets);

View file

@ -210,6 +210,7 @@ gtk2_ardour_sources = [
'selection.cc',
'send_ui.cc',
'session_dialog.cc',
'session_dialog.logic.cc',
'session_lock_dialog.cc',
'session_import_dialog.cc',
'session_metadata_dialog.cc',