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
1a59afa3
Commit
1a59afa3
authored
Jan 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stored_playlist: moved configuration variables from playlist.c
Don't declare and export variables specific to stored playlists in playlist.c/playlist.h.
parent
85f7e964
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
19 deletions
+32
-19
conf.h
src/conf.h
+3
-0
main.c
src/main.c
+2
-0
playlist.c
src/playlist.c
+3
-14
playlist.h
src/playlist.h
+0
-4
playlist_save.c
src/playlist_save.c
+1
-1
stored_playlist.c
src/stored_playlist.c
+15
-0
stored_playlist.h
src/stored_playlist.h
+8
-0
No files found.
src/conf.h
View file @
1a59afa3
...
...
@@ -69,6 +69,9 @@
#define CONF_BOOL_UNSET -1
#define CONF_BOOL_INVALID -2
#define DEFAULT_PLAYLIST_MAX_LENGTH (1024*16)
#define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS false
struct
block_param
{
char
*
name
;
char
*
value
;
...
...
src/main.c
View file @
1a59afa3
...
...
@@ -22,6 +22,7 @@
#include "idle.h"
#include "command.h"
#include "playlist.h"
#include "stored_playlist.h"
#include "database.h"
#include "update.h"
#include "player_thread.h"
...
...
@@ -230,6 +231,7 @@ int main(int argc, char *argv[])
mapper_init
();
initPermissions
();
initPlaylist
();
spl_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
...
...
src/playlist.c
View file @
1a59afa3
...
...
@@ -67,17 +67,11 @@
#define PLAYLIST_HASH_MULT 4
#define DEFAULT_PLAYLIST_MAX_LENGTH (1024*16)
#define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS false
/** random number generator fur shuffling */
static
GRand
*
g_rand
;
/** the global playlist object */
static
struct
playlist
playlist
;
unsigned
playlist_max_length
;
bool
playlist_saveAbsolutePaths
=
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
;
static
void
playPlaylistOrderNumber
(
int
orderNum
);
...
...
@@ -110,18 +104,13 @@ void initPlaylist(void)
{
g_rand
=
g_rand_new
();
playlist_max_length
=
config_get_positive
(
CONF_MAX_PLAYLIST_LENGTH
,
DEFAULT_PLAYLIST_MAX_LENGTH
);
queue_init
(
&
playlist
.
queue
,
playlist_max_length
);
queue_init
(
&
playlist
.
queue
,
config_get_positive
(
CONF_MAX_PLAYLIST_LENGTH
,
DEFAULT_PLAYLIST_MAX_LENGTH
));
playlist
.
queued
=
-
1
;
playlist
.
current
=
-
1
;
playlist_saveAbsolutePaths
=
config_get_bool
(
CONF_SAVE_ABSOLUTE_PATHS
,
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
);
event_pipe_register
(
PIPE_EVENT_TAG
,
playlist_tag_event
);
}
...
...
src/playlist.h
View file @
1a59afa3
...
...
@@ -83,10 +83,6 @@ struct playlist {
int
queued
;
};
extern
bool
playlist_saveAbsolutePaths
;
extern
unsigned
playlist_max_length
;
void
initPlaylist
(
void
);
void
finishPlaylist
(
void
);
...
...
src/playlist_save.c
View file @
1a59afa3
...
...
@@ -17,7 +17,7 @@
*/
#include "playlist_save.h"
#include "playlist.h"
#include "
stored_
playlist.h"
#include "song.h"
#include "mapper.h"
#include "path.h"
...
...
src/stored_playlist.c
View file @
1a59afa3
...
...
@@ -24,6 +24,7 @@
#include "ls.h"
#include "database.h"
#include "idle.h"
#include "conf.h"
#include <assert.h>
#include <sys/types.h>
...
...
@@ -33,6 +34,20 @@
#include <string.h>
#include <errno.h>
static
unsigned
playlist_max_length
;
bool
playlist_saveAbsolutePaths
=
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
;
void
spl_global_init
(
void
)
{
playlist_max_length
=
config_get_positive
(
CONF_MAX_PLAYLIST_LENGTH
,
DEFAULT_PLAYLIST_MAX_LENGTH
);
playlist_saveAbsolutePaths
=
config_get_bool
(
CONF_SAVE_ABSOLUTE_PATHS
,
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
);
}
static
struct
stored_playlist_info
*
load_playlist_info
(
const
char
*
parent_path_fs
,
const
char
*
name_fs
)
{
...
...
src/stored_playlist.h
View file @
1a59afa3
...
...
@@ -32,6 +32,14 @@ struct stored_playlist_info {
time_t
mtime
;
};
extern
bool
playlist_saveAbsolutePaths
;
/**
* Perform some global initialization, e.g. load configuration values.
*/
void
spl_global_init
(
void
);
/**
* Returns a list of stored_playlist_info struct pointers. Returns
* NULL if an error occured.
...
...
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