partial dialog to control track duplication
[ardour.git] / gtk2_ardour / duplicate_routes_dialog.cc
1 /*
2     Copyright (C) 2015 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #include "gtkmm/stock.h"
21
22 #include "duplicate_routes_dialog.h"
23
24 #include "i18n.h"
25
26 DuplicateRouteDialog::DuplicateRouteDialog ()
27         : ArdourDialog (_("Duplicate Tracks & Busses"), false, false)
28         , copy_playlists_button (playlist_button_group, _("Copy playlists"))
29         , new_playlists_button (playlist_button_group, _("Create new (empty) playlists"))
30         , share_playlists_button (playlist_button_group, _("Share playlists"))
31         , count_adjustment (1.0, 1.0, 999, 1.0, 10.0)
32         , count_spinner (count_adjustment)
33 {
34         playlist_button_box.pack_start (copy_playlists_button, false, false);
35         playlist_button_box.pack_start (new_playlists_button, false, false);
36         playlist_button_box.pack_start (share_playlists_button, false, false);
37
38         get_vbox()->pack_start (playlist_button_box, false, false);
39         get_vbox()->show_all ();
40
41         add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
42         add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
43 }
44
45 DuplicateRouteDialog::~DuplicateRouteDialog ()
46 {
47 }
48
49 uint32_t
50 DuplicateRouteDialog::count() const
51 {
52         return count_adjustment.get_value ();
53 }
54
55 ARDOUR::PlaylistDisposition
56 DuplicateRouteDialog::playlist_disposition() const
57 {
58         if (new_playlists_button.get_active()) {
59                 return ARDOUR::NewPlaylist;
60         } else if (copy_playlists_button.get_active()) {
61                 return ARDOUR::CopyPlaylist;
62         } 
63
64         return ARDOUR::SharePlaylist;
65 }