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
2071070f
Commit
2071070f
authored
Jan 08, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DespotifyUtils: return Tag, not pointer
parent
89a78a5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
DespotifyUtils.cxx
src/DespotifyUtils.cxx
+3
-4
DespotifyUtils.hxx
src/DespotifyUtils.hxx
+2
-2
DespotifyInputPlugin.cxx
src/input/DespotifyInputPlugin.cxx
+6
-5
DespotifyPlaylistPlugin.cxx
src/playlist/DespotifyPlaylistPlugin.cxx
+1
-1
No files found.
src/DespotifyUtils.cxx
View file @
2071070f
...
...
@@ -83,8 +83,7 @@ void mpd_despotify_unregister_callback(void (*cb)(struct despotify_session *, in
}
}
Tag
*
Tag
mpd_despotify_tag_from_track
(
const
ds_track
&
track
)
{
char
tracknum
[
20
];
...
...
@@ -92,7 +91,7 @@ mpd_despotify_tag_from_track(const ds_track &track)
char
date
[
20
];
if
(
!
track
.
has_meta_data
)
return
new
Tag
();
return
Tag
();
TagBuilder
tag
;
snprintf
(
tracknum
,
sizeof
(
tracknum
),
"%d"
,
track
.
tracknumber
);
...
...
@@ -108,7 +107,7 @@ mpd_despotify_tag_from_track(const ds_track &track)
tag
.
AddItem
(
TAG_COMMENT
,
comment
);
tag
.
SetTime
(
track
.
length
/
1000
);
return
tag
.
Commit
New
();
return
tag
.
Commit
();
}
struct
despotify_session
*
mpd_despotify_get_session
(
void
)
...
...
src/DespotifyUtils.hxx
View file @
2071070f
...
...
@@ -42,9 +42,9 @@ struct despotify_session *mpd_despotify_get_session(void);
*
* @param track the track to convert
*
* @return
a pointer to the filled in tags
structure
* @return
filled in #Tag
structure
*/
Tag
*
Tag
mpd_despotify_tag_from_track
(
const
ds_track
&
track
);
/**
...
...
src/input/DespotifyInputPlugin.cxx
View file @
2071070f
...
...
@@ -41,7 +41,7 @@ class DespotifyInputStream {
struct
despotify_session
*
session
;
struct
ds_track
*
track
;
Tag
*
tag
;
Tag
tag
;
struct
ds_pcm_data
pcm
;
size_t
len_available
;
bool
eof
;
...
...
@@ -64,8 +64,6 @@ class DespotifyInputStream {
public
:
~
DespotifyInputStream
()
{
delete
tag
;
despotify_free_track
(
track
);
}
...
...
@@ -79,8 +77,11 @@ public:
size_t
Read
(
void
*
ptr
,
size_t
size
,
Error
&
error
);
Tag
*
ReadTag
()
{
Tag
*
result
=
tag
;
tag
=
nullptr
;
if
(
tag
.
IsEmpty
())
return
nullptr
;
Tag
*
result
=
new
Tag
(
std
::
move
(
tag
));
tag
.
Clear
();
return
result
;
}
...
...
src/playlist/DespotifyPlaylistPlugin.cxx
View file @
2071070f
...
...
@@ -53,7 +53,7 @@ add_song(std::forward_list<SongPointer> &songs, ds_track &track)
}
song
=
Song
::
NewRemote
(
uri
);
song
->
tag
=
mpd_despotify_tag_from_track
(
track
);
song
->
tag
=
new
Tag
(
mpd_despotify_tag_from_track
(
track
)
);
songs
.
emplace_front
(
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