song: removed type SongList
SongList has been superseded by struct songvec.
This commit is contained in:
parent
e2a12deead
commit
323e86489f
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "songvec.h"
|
#include "songvec.h"
|
||||||
|
#include "list.h"
|
||||||
|
|
||||||
typedef List DirectoryList;
|
typedef List DirectoryList;
|
||||||
|
|
||||||
|
1
src/ls.c
1
src/ls.c
@ -23,6 +23,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "utf8.h"
|
#include "utf8.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "list.h"
|
||||||
#include "os_compat.h"
|
#include "os_compat.h"
|
||||||
|
|
||||||
static const char *remoteUrlPrefixes[] = {
|
static const char *remoteUrlPrefixes[] = {
|
||||||
|
36
src/song.c
36
src/song.c
@ -92,42 +92,6 @@ void freeJustSong(Song * song)
|
|||||||
free(song);
|
free(song);
|
||||||
}
|
}
|
||||||
|
|
||||||
SongList *newSongList(void)
|
|
||||||
{
|
|
||||||
return makeList((ListFreeDataFunc *) freeSong, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Song *addSongToList(SongList * list, const char *url, const char *utf8path,
|
|
||||||
int songType, Directory * parentDirectory)
|
|
||||||
{
|
|
||||||
Song *song = NULL;
|
|
||||||
|
|
||||||
switch (songType) {
|
|
||||||
case SONG_TYPE_FILE:
|
|
||||||
if (isMusic(utf8path, NULL, 0)) {
|
|
||||||
song = newSong(url, songType, parentDirectory);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SONG_TYPE_URL:
|
|
||||||
song = newSong(url, songType, parentDirectory);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
DEBUG("addSongToList: Trying to add an invalid song type\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (song == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
insertInList(list, song->url, (void *)song);
|
|
||||||
|
|
||||||
return song;
|
|
||||||
}
|
|
||||||
|
|
||||||
void freeSongList(SongList * list)
|
|
||||||
{
|
|
||||||
freeList(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
int updateSongInfo(Song * song)
|
int updateSongInfo(Song * song)
|
||||||
{
|
{
|
||||||
if (song->type == SONG_TYPE_FILE) {
|
if (song->type == SONG_TYPE_FILE) {
|
||||||
|
10
src/song.h
10
src/song.h
@ -19,7 +19,6 @@
|
|||||||
#ifndef SONG_H
|
#ifndef SONG_H
|
||||||
#define SONG_H
|
#define SONG_H
|
||||||
|
|
||||||
#include "list.h"
|
|
||||||
#include "os_compat.h"
|
#include "os_compat.h"
|
||||||
#include "mpd_types.h"
|
#include "mpd_types.h"
|
||||||
|
|
||||||
@ -42,8 +41,6 @@ typedef struct _Song {
|
|||||||
time_t mtime;
|
time_t mtime;
|
||||||
} Song;
|
} Song;
|
||||||
|
|
||||||
typedef List SongList;
|
|
||||||
|
|
||||||
Song *newNullSong(void);
|
Song *newNullSong(void);
|
||||||
|
|
||||||
Song *newSong(const char *url, int songType, struct _Directory *parentDir);
|
Song *newSong(const char *url, int songType, struct _Directory *parentDir);
|
||||||
@ -52,13 +49,6 @@ void freeSong(Song *);
|
|||||||
|
|
||||||
void freeJustSong(Song *);
|
void freeJustSong(Song *);
|
||||||
|
|
||||||
SongList *newSongList(void);
|
|
||||||
|
|
||||||
void freeSongList(SongList * list);
|
|
||||||
|
|
||||||
Song *addSongToList(SongList * list, const char *url, const char *utf8path,
|
|
||||||
int songType, struct _Directory *parentDir);
|
|
||||||
|
|
||||||
int updateSongInfo(Song * song);
|
int updateSongInfo(Song * song);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user