Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
05c91082
Commit
05c91082
authored
Jan 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: convert to C++
parent
7267558b
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
76 additions
and
74 deletions
+76
-74
Makefile.am
Makefile.am
+7
-8
DatabaseQueue.cxx
src/DatabaseQueue.cxx
+1
-5
Main.cxx
src/Main.cxx
+1
-1
PlayerCommands.cxx
src/PlayerCommands.cxx
+1
-1
Playlist.cxx
src/Playlist.cxx
+6
-3
Playlist.hxx
src/Playlist.hxx
+4
-4
PlaylistCommands.cxx
src/PlaylistCommands.cxx
+1
-1
PlaylistControl.cxx
src/PlaylistControl.cxx
+6
-4
PlaylistEdit.cxx
src/PlaylistEdit.cxx
+2
-1
PlaylistGlobal.cxx
src/PlaylistGlobal.cxx
+6
-3
PlaylistInternal.hxx
src/PlaylistInternal.hxx
+4
-4
PlaylistPrint.cxx
src/PlaylistPrint.cxx
+1
-1
PlaylistQueue.cxx
src/PlaylistQueue.cxx
+1
-1
PlaylistSave.cxx
src/PlaylistSave.cxx
+2
-2
PlaylistState.cxx
src/PlaylistState.cxx
+2
-2
Queue.cxx
src/Queue.cxx
+14
-14
Queue.hxx
src/Queue.hxx
+3
-3
QueueCommands.cxx
src/QueueCommands.cxx
+1
-1
QueuePrint.cxx
src/QueuePrint.cxx
+2
-2
QueueSave.cxx
src/QueueSave.cxx
+1
-1
StateFile.cxx
src/StateFile.cxx
+1
-1
UpdateGlue.cxx
src/UpdateGlue.cxx
+2
-2
UpdateRemove.cxx
src/UpdateRemove.cxx
+1
-1
replay_gain_config.c
src/replay_gain_config.c
+2
-2
TestQueuePriority.cxx
test/TestQueuePriority.cxx
+1
-3
run_filter.c
test/run_filter.c
+2
-2
run_output.cxx
test/run_output.cxx
+1
-1
No files found.
Makefile.am
View file @
05c91082
...
...
@@ -115,9 +115,9 @@ mpd_headers = \
src/output/httpd_internal.h
\
src/page.h
\
src/player_control.h
\
src/
playlist.h
\
src/
Playlist.hxx
\
src/playlist_error.h
\
src/
playlist_internal.h
\
src/
PlaylistInternal.hxx
\
src/playlist_plugin.h
\
src/playlist_list.h
\
src/playlist/extm3u_playlist_plugin.h
\
...
...
@@ -132,7 +132,6 @@ mpd_headers = \
src/poison.h
\
src/riff.h
\
src/aiff.h
\
src/queue.h
\
src/refcount.h
\
src/replay_gain_config.h
\
src/replay_gain_info.h
\
...
...
@@ -267,9 +266,9 @@ src_mpd_SOURCES = \
src/Permission.cxx src/Permission.hxx
\
src/PlayerThread.cxx src/PlayerThread.hxx
\
src/PlayerControl.cxx
\
src/
playlist.c
\
src/
playlist_global.c
\
src/
playlist_control.c
\
src/
Playlist.cxx
\
src/
PlaylistGlobal.cxx
\
src/
PlaylistControl.cxx
\
src/PlaylistEdit.cxx
\
src/PlaylistPrint.cxx src/PlaylistPrint.hxx
\
src/PlaylistSave.cxx src/PlaylistSave.hxx
\
...
...
@@ -281,7 +280,7 @@ src_mpd_SOURCES = \
src/PlaylistVector.cxx src/PlaylistVector.hxx
\
src/PlaylistInfo.hxx
\
src/PlaylistDatabase.cxx
\
src/
queue.c
\
src/
Queue.cxx src/Queue.hxx
\
src/QueuePrint.cxx src/QueuePrint.hxx
\
src/QueueSave.cxx src/QueueSave.hxx
\
src/replay_gain_config.c
\
...
...
@@ -1339,7 +1338,7 @@ test_test_pcm_LDADD = \
$(GLIB_LIBS)
test_TestQueuePriority_SOURCES
=
\
src/
queue.c
\
src/
Queue.cxx
\
test
/TestQueuePriority.cxx
test_TestQueuePriority_LDADD
=
\
$(GLIB_LIBS)
...
...
src/DatabaseQueue.cxx
View file @
05c91082
...
...
@@ -20,13 +20,9 @@
#include "config.h"
#include "DatabaseQueue.hxx"
#include "DatabaseSelection.hxx"
extern
"C"
{
#include "playlist.h"
}
#include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx"
#include "Playlist.hxx"
#include <functional>
...
...
src/Main.cxx
View file @
05c91082
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "Main.hxx"
#include "CommandLine.hxx"
#include "Playlist.hxx"
#include "PlaylistFile.hxx"
#include "UpdateGlue.hxx"
#include "MusicChunk.hxx"
...
...
@@ -38,7 +39,6 @@ extern "C" {
#include "daemon.h"
#include "io_thread.h"
#include "idle.h"
#include "playlist.h"
#include "conf.h"
#include "path.h"
#include "player_control.h"
...
...
src/PlayerCommands.cxx
View file @
05c91082
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "PlayerCommands.hxx"
#include "CommandError.hxx"
#include "Playlist.hxx"
#include "PlaylistPrint.hxx"
#include "UpdateGlue.hxx"
#include "ClientInternal.hxx"
...
...
@@ -28,7 +29,6 @@
extern
"C"
{
#include "player_control.h"
#include "playlist.h"
#include "volume.h"
#include "replay_gain_config.h"
}
...
...
src/
playlist.c
→
src/
Playlist.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,11 +18,14 @@
*/
#include "config.h"
#include "playlist_internal.h"
#include "player_control.h"
#include "PlaylistInternal.hxx"
#include "song.h"
extern
"C"
{
#include "player_control.h"
#include "conf.h"
#include "idle.h"
}
#include <glib.h>
...
...
src/
playlist.h
→
src/
Playlist.hxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_PLAYLIST_H
#define MPD_PLAYLIST_H
#ifndef MPD_PLAYLIST_H
XX
#define MPD_PLAYLIST_H
XX
#include "
queue.h
"
#include "
Queue.hxx
"
#include "playlist_error.h"
#include <stdbool.h>
...
...
src/PlaylistCommands.cxx
View file @
05c91082
...
...
@@ -31,9 +31,9 @@
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
#include "ls.hxx"
#include "Playlist.hxx"
extern
"C"
{
#include "playlist.h"
#include "uri.h"
}
...
...
src/
playlist_control.c
→
src/
PlaylistControl.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -23,10 +23,12 @@
*/
#include "config.h"
#include "playlist_internal.h"
#include "player_control.h"
#include "PlaylistInternal.hxx"
#include "song.h"
#include "idle.h"
extern
"C"
{
#include "player_control.h"
}
#include <glib.h>
...
...
src/PlaylistEdit.cxx
View file @
05c91082
...
...
@@ -24,8 +24,9 @@
*/
#include "config.h"
#include "PlaylistInternal.hxx"
extern
"C"
{
#include "playlist_internal.h"
#include "player_control.h"
#include "uri.h"
#include "song.h"
...
...
src/
playlist_global.c
→
src/
PlaylistGlobal.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -23,10 +23,13 @@
*/
#include "config.h"
#include "playlist.h"
#include "event_pipe.h"
#include "Playlist.hxx"
#include "Main.hxx"
extern
"C"
{
#include "event_pipe.h"
}
struct
playlist
g_playlist
;
static
void
...
...
src/
playlist_internal.h
→
src/
PlaylistInternal.hxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -22,10 +22,10 @@
*
*/
#ifndef
PLAYLIST_INTERNAL_H
#define
PLAYLIST_INTERNAL_H
#ifndef
MPD_PLAYLIST_INTERNAL_HXX
#define
MPD_PLAYLIST_INTERNAL_HXX
#include "
playlist.h
"
#include "
Playlist.hxx
"
struct
player_control
;
...
...
src/PlaylistPrint.cxx
View file @
05c91082
...
...
@@ -22,6 +22,7 @@
#include "PlaylistFile.hxx"
#include "PlaylistAny.hxx"
#include "PlaylistSong.hxx"
#include "Playlist.hxx"
#include "QueuePrint.hxx"
#include "SongPrint.hxx"
#include "DatabaseGlue.hxx"
...
...
@@ -31,7 +32,6 @@
extern
"C"
{
#include "playlist_list.h"
#include "playlist_plugin.h"
#include "playlist.h"
#include "song.h"
#include "input_stream.h"
}
...
...
src/PlaylistQueue.cxx
View file @
05c91082
...
...
@@ -22,9 +22,9 @@
#include "playlist_plugin.h"
#include "PlaylistAny.hxx"
#include "PlaylistSong.hxx"
#include "Playlist.hxx"
extern
"C"
{
#include "playlist.h"
#include "song.h"
#include "input_stream.h"
}
...
...
src/PlaylistSave.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -20,11 +20,11 @@
#include "config.h"
#include "PlaylistSave.hxx"
#include "PlaylistFile.hxx"
#include "Playlist.hxx"
#include "song.h"
#include "Mapper.hxx"
extern
"C"
{
#include "playlist.h"
#include "path.h"
#include "uri.h"
#include "idle.h"
...
...
src/PlaylistState.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -24,11 +24,11 @@
#include "config.h"
#include "PlaylistState.hxx"
#include "Playlist.hxx"
#include "QueueSave.hxx"
#include "TextFile.hxx"
extern
"C"
{
#include "playlist.h"
#include "player_control.h"
#include "conf.h"
}
...
...
src/
queue.c
→
src/
Queue.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
queue.h
"
#include "
Queue.hxx
"
#include "song.h"
#include <stdlib.h>
...
...
@@ -102,12 +102,11 @@ queue_append(struct queue *queue, struct song *song, uint8_t priority)
assert
(
!
queue_is_full
(
queue
));
queue
->
items
[
queue
->
length
]
=
(
struct
queue_item
){
.
song
=
song_dup_detached
(
song
),
.
id
=
id
,
.
version
=
queue
->
version
,
.
priority
=
priority
,
};
auto
&
item
=
queue
->
items
[
queue
->
length
];
item
.
song
=
song_dup_detached
(
song
);
item
.
id
=
id
;
item
.
version
=
queue
->
version
;
item
.
priority
=
priority
;
queue
->
order
[
queue
->
length
]
=
queue
->
length
;
queue
->
id_to_position
[
id
]
=
queue
->
length
;
...
...
@@ -313,9 +312,10 @@ queue_init(struct queue *queue, unsigned max_length)
queue
->
consume
=
false
;
queue
->
items
=
g_new
(
struct
queue_item
,
max_length
);
queue
->
order
=
g_malloc
(
sizeof
(
queue
->
order
[
0
])
*
max_length
);
queue
->
id_to_position
=
g_malloc
(
sizeof
(
queue
->
id_to_position
[
0
])
*
queue
->
order
=
(
unsigned
*
)
g_malloc
(
sizeof
(
queue
->
order
[
0
])
*
max_length
);
queue
->
id_to_position
=
(
int
*
)
g_malloc
(
sizeof
(
queue
->
id_to_position
[
0
])
*
max_length
*
QUEUE_HASH_MULT
);
for
(
unsigned
i
=
0
;
i
<
max_length
*
QUEUE_HASH_MULT
;
++
i
)
...
...
@@ -355,9 +355,9 @@ static gint
queue_item_compare_order_priority
(
gconstpointer
av
,
gconstpointer
bv
,
gpointer
user_data
)
{
const
struct
queue
*
queue
=
user_data
;
const
unsigned
*
const
ap
=
av
;
const
unsigned
*
const
bp
=
bv
;
const
struct
queue
*
queue
=
(
const
struct
queue
*
)
user_data
;
const
unsigned
*
const
ap
=
(
const
unsigned
*
)
av
;
const
unsigned
*
const
bp
=
(
const
unsigned
*
)
bv
;
assert
(
ap
>=
queue
->
order
&&
ap
<
queue
->
order
+
queue
->
length
);
assert
(
bp
>=
queue
->
order
&&
bp
<
queue
->
order
+
queue
->
length
);
uint8_t
a
=
queue
->
items
[
*
ap
].
priority
;
...
...
src/
queue.h
→
src/
Queue.hxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef
QUEUE_H
#define
QUEUE_H
#ifndef
MPD_QUEUE_HXX
#define
MPD_QUEUE_HXX
#include <glib.h>
...
...
src/QueueCommands.cxx
View file @
05c91082
...
...
@@ -22,6 +22,7 @@
#include "CommandError.hxx"
#include "DatabaseQueue.hxx"
#include "SongFilter.hxx"
#include "Playlist.hxx"
#include "PlaylistPrint.hxx"
#include "ClientFile.hxx"
#include "ClientInternal.hxx"
...
...
@@ -30,7 +31,6 @@
#include "ls.hxx"
extern
"C"
{
#include "playlist.h"
#include "uri.h"
}
...
...
src/QueuePrint.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -19,13 +19,13 @@
#include "config.h"
#include "QueuePrint.hxx"
#include "Queue.hxx"
#include "SongFilter.hxx"
#include "SongPrint.hxx"
#include "Mapper.hxx"
#include "Client.hxx"
extern
"C"
{
#include "queue.h"
#include "song.h"
}
...
...
src/QueueSave.cxx
View file @
05c91082
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include "QueueSave.hxx"
#include "Playlist.hxx"
#include "song.h"
#include "SongSave.hxx"
#include "DatabasePlugin.hxx"
...
...
@@ -26,7 +27,6 @@
#include "TextFile.hxx"
extern
"C"
{
#include "queue.h"
#include "uri.h"
}
...
...
src/StateFile.cxx
View file @
05c91082
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "StateFile.hxx"
#include "OutputState.hxx"
#include "
playlist.h
"
#include "
Playlist.hxx
"
#include "PlaylistState.hxx"
#include "TextFile.hxx"
...
...
src/UpdateGlue.cxx
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -24,9 +24,9 @@
#include "UpdateRemove.hxx"
#include "Mapper.hxx"
#include "DatabaseSimple.hxx"
#include "Playlist.hxx"
extern
"C"
{
#include "playlist.h"
#include "event_pipe.h"
#include "idle.h"
#include "stats.h"
...
...
src/UpdateRemove.cxx
View file @
05c91082
...
...
@@ -19,10 +19,10 @@
#include "config.h"
/* must be first for large file support */
#include "UpdateRemove.hxx"
#include "Playlist.hxx"
extern
"C"
{
#include "event_pipe.h"
#include "playlist.h"
}
#include "song.h"
...
...
src/replay_gain_config.c
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -19,7 +19,7 @@
#include "config.h"
#include "replay_gain_config.h"
#include "
playlist.h
"
#include "
Playlist.hxx
"
#include "conf.h"
#include "idle.h"
#include "mpd_error.h"
...
...
test/TestQueuePriority.cxx
View file @
05c91082
#include "config.h"
extern
"C"
{
#include "queue.h"
}
#include "Queue.hxx"
#include "song.h"
#include "Directory.hxx"
...
...
test/run_filter.c
View file @
05c91082
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -25,7 +25,7 @@
#include "pcm_volume.h"
#include "idle.h"
#include "mixer_control.h"
#include "
playlist.h
"
#include "
Playlist.hxx
"
#include "stdbin.h"
#include <glib.h>
...
...
test/run_output.cxx
View file @
05c91082
...
...
@@ -32,7 +32,7 @@ extern "C" {
#include "idle.h"
}
#include "
playlist.h
"
#include "
Playlist.hxx
"
#include "player_control.h"
#include "stdbin.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment