2 Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "lib/sndfile_content.h"
22 #include "sndfile_content_dialog.h"
25 using boost::shared_ptr;
27 SndfileContentDialog::SndfileContentDialog (wxWindow* parent, shared_ptr<SndfileContent> content)
28 : wxDialog (parent, wxID_ANY, _("Sound file"))
30 wxFlexGridSizer* grid = new wxFlexGridSizer (7, 6, 0);
32 add_label_to_sizer (grid, this, wxT (""));
33 add_label_to_sizer (grid, this, _("L"));
34 add_label_to_sizer (grid, this, _("R"));
35 add_label_to_sizer (grid, this, _("C"));
36 add_label_to_sizer (grid, this, _("Lfe"));
37 add_label_to_sizer (grid, this, _("Ls"));
38 add_label_to_sizer (grid, this, _("Rs"));
40 _buttons.resize (content->audio_channels ());
41 for (int i = 0; i < content->audio_channels(); ++i) {
43 if (content->audio_channels() == 1) {
44 add_label_to_sizer (grid, this, _("Source"));
46 add_label_to_sizer (grid, this, wxString::Format (_("Source %d"), i + 1));
49 for (int j = 0; j < MAX_AUDIO_CHANNELS; ++j) {
50 wxRadioButton* b = new wxRadioButton (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, j ? 0 : wxRB_GROUP);
51 _buttons[i].push_back (b);
52 grid->Add (b, wxSHRINK);
56 wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
57 overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6);
59 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
61 overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
64 SetSizer (overall_sizer);
65 overall_sizer->Layout ();
66 overall_sizer->SetSizeHints (this);