blob: b67920198d23bb5f50df6f3a07944e94d7ba0e94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
/* Audacious - Cross-platform multimedia player
* Copyright (C) 2005-2011 Audacious development team.
*
* BMP - Cross-platform multimedia player
* Copyright (C) 2003-2004 BMP development team.
*
* Based on XMMS:
* Copyright (C) 1998-2003 XMMS development team.
*
* 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; under version 3 of the License.
*
* 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, see <http://www.gnu.org/licenses>.
*
* The Audacious team does not consider modular code linking to
* Audacious or using our public API to be a derived work.
*/
#include "actions-mainwin.h"
#include "actions-playlist.h"
#include "main.h"
#include "plugin-window.h"
#include "../ui-common/menu-ops.h"
#include <gtk/gtk.h>
#include <libaudcore/drct.h>
#include <libaudcore/i18n.h>
#include <libaudcore/playlist.h>
#include <libaudcore/plugins.h>
#include <libaudgui/libaudgui.h>
#define ACTIVE (Playlist::active_playlist ())
void action_ab_clear ()
{
mainwin_show_status_message (_("Repeat points cleared."));
aud_drct_set_ab_repeat (-1, -1);
}
void action_ab_set ()
{
if (aud_drct_get_length () > 0)
{
int a, b;
aud_drct_get_ab_repeat (a, b);
if (a < 0 || b >= 0)
{
a = aud_drct_get_time ();
b = -1;
mainwin_show_status_message (_("Repeat point A set."));
}
else
{
b = aud_drct_get_time ();
mainwin_show_status_message (_("Repeat point B set."));
}
aud_drct_set_ab_repeat (a, b);
}
}
void action_play_file ()
{ audgui_run_filebrowser (true); }
void action_play_location ()
{ audgui_show_add_url_window (true); }
void action_playlist_manager ()
{
PluginHandle * manager = aud_plugin_lookup_basename ("playlist-manager");
if (manager)
{
aud_plugin_enable (manager, true);
focus_plugin_window (manager);
}
}
void action_search_tool ()
{
PluginHandle * search = aud_plugin_lookup_basename ("search-tool");
if (search)
{
aud_plugin_enable (search, true);
focus_plugin_window (search);
}
}
void action_playlist_rename ()
{ audgui_show_playlist_rename (ACTIVE); }
void action_playlist_delete ()
{ audgui_confirm_playlist_delete (ACTIVE); }
void action_playlist_add_url ()
{ audgui_show_add_url_window (false); }
void action_playlist_add_files ()
{ audgui_run_filebrowser (false); }
|