Skip to content

Commit

Permalink
Remove unused URLSong functionality
Browse files Browse the repository at this point in the history
This isn't supported with the OpenAL backend, and instead of trying to make a
workaround for it, a better approach would probably be to make a FileReader
implementation that handles URLs.
  • Loading branch information
kcat authored and coelckers committed Apr 24, 2017
1 parent e78d880 commit 78231d5
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 47 deletions.
17 changes: 2 additions & 15 deletions src/s_sound.cpp
Expand Up @@ -2596,21 +2596,8 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
{
if ((lumpnum = Wads.CheckNumForFullName (musicname, true, ns_music)) == -1)
{
if (strstr(musicname, "://") > musicname)
{
// Looks like a URL; try it as such.
handle = I_RegisterURLSong(musicname);
if (handle == NULL)
{
Printf ("Could not open \"%s\"\n", musicname);
return false;
}
}
else
{
Printf ("Music \"%s\" not found\n", musicname);
return false;
}
Printf ("Music \"%s\" not found\n", musicname);
return false;
}
if (handle == NULL)
{
Expand Down
19 changes: 0 additions & 19 deletions src/sound/i_music.cpp
Expand Up @@ -558,25 +558,6 @@ MusInfo *I_RegisterCDSong (int track, int id)
return info;
}

//==========================================================================
//
//
//
//==========================================================================

MusInfo *I_RegisterURLSong (const char *url)
{
StreamSong *song;

song = new StreamSong(url);
if (song->IsValid())
{
return song;
}
delete song;
return NULL;
}

//==========================================================================
//
// ungzip
Expand Down
1 change: 0 additions & 1 deletion src/sound/i_music.h
Expand Up @@ -57,7 +57,6 @@ class MusInfo;
struct MidiDeviceSetting;
MusInfo *I_RegisterSong (FileReader *reader, MidiDeviceSetting *device);
MusInfo *I_RegisterCDSong (int track, int cdid = 0);
MusInfo *I_RegisterURLSong (const char *url);

// The base music class. Everything is derived from this --------------------

Expand Down
1 change: 0 additions & 1 deletion src/sound/i_musicinterns.h
Expand Up @@ -594,7 +594,6 @@ class StreamSong : public MusInfo
{
public:
StreamSong (FileReader *reader);
StreamSong (const char *url);
~StreamSong ();
void Play (bool looping, int subsong);
void Pause ();
Expand Down
5 changes: 0 additions & 5 deletions src/sound/i_sound.cpp
Expand Up @@ -576,11 +576,6 @@ std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int le
return retval;
}

SoundStream *SoundRenderer::OpenStream(const char *url, int flags)
{
return 0;
}

SoundDecoder *SoundRenderer::CreateDecoder(FileReader *reader)
{
SoundDecoder *decoder = NULL;
Expand Down
1 change: 0 additions & 1 deletion src/sound/i_sound.h
Expand Up @@ -108,7 +108,6 @@ class SoundRenderer
// Streaming sounds.
virtual SoundStream *CreateStream (SoundStreamCallback callback, int buffbytes, int flags, int samplerate, void *userdata) = 0;
virtual SoundStream *OpenStream (FileReader *reader, int flags) = 0;
virtual SoundStream *OpenStream (const char *url, int flags);

// Starts a sound.
virtual FISoundChannel *StartSound (SoundHandle sfx, float vol, int pitch, int chanflags, FISoundChannel *reuse_chan) = 0;
Expand Down
5 changes: 0 additions & 5 deletions src/sound/musicformats/music_stream.cpp
Expand Up @@ -90,11 +90,6 @@ StreamSong::StreamSong (FileReader *reader)
m_Stream = GSnd->OpenStream (reader, SoundStream::Loop);
}

StreamSong::StreamSong (const char *url)
{
m_Stream = GSnd->OpenStream (url, SoundStream::Loop);
}

bool StreamSong::IsPlaying ()
{
if (m_Status != STATE_Stopped)
Expand Down

0 comments on commit 78231d5

Please sign in to comment.