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
df563db2
Commit
df563db2
authored
Feb 12, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
song: add function song_replace_uri()
parent
01b0d9eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
song.c
src/song.c
+12
-0
song.h
src/song.h
+9
-0
No files found.
src/song.c
View file @
df563db2
...
@@ -61,6 +61,18 @@ song_file_new(const char *path, struct directory *parent)
...
@@ -61,6 +61,18 @@ song_file_new(const char *path, struct directory *parent)
return
song_alloc
(
path
,
parent
);
return
song_alloc
(
path
,
parent
);
}
}
struct
song
*
song_replace_uri
(
struct
song
*
old_song
,
const
char
*
uri
)
{
struct
song
*
new_song
=
song_alloc
(
uri
,
old_song
->
parent
);
new_song
->
tag
=
old_song
->
tag
;
new_song
->
mtime
=
old_song
->
mtime
;
new_song
->
start_ms
=
old_song
->
start_ms
;
new_song
->
end_ms
=
old_song
->
end_ms
;
g_free
(
old_song
);
return
new_song
;
}
void
void
song_free
(
struct
song
*
song
)
song_free
(
struct
song
*
song
)
{
{
...
...
src/song.h
View file @
df563db2
...
@@ -74,6 +74,15 @@ song_file_new(const char *path, struct directory *parent);
...
@@ -74,6 +74,15 @@ song_file_new(const char *path, struct directory *parent);
struct
song
*
struct
song
*
song_file_load
(
const
char
*
path
,
struct
directory
*
parent
);
song_file_load
(
const
char
*
path
,
struct
directory
*
parent
);
/**
* Replaces the URI of a song object. The given song object is
* destroyed, and a newly allocated one is returned. It does not
* update the reference within the parent directory; the caller is
* responsible for doing that.
*/
struct
song
*
song_replace_uri
(
struct
song
*
song
,
const
char
*
uri
);
void
void
song_free
(
struct
song
*
song
);
song_free
(
struct
song
*
song
);
...
...
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