1 /*****************************************************************************
2 * vlm_stream.cpp : Implementation of the VLMStream class hierarchy
3 *****************************************************************************
4 * Copyright (C) 2000-2005 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
25 #include "dialogs/vlm/vlm_stream.hpp"
26 #include "dialogs/vlm/vlm_wrapper.hpp"
28 /*****************************************************************************
30 *****************************************************************************/
31 VLMStream::VLMStream( intf_thread_t *_p_intf, vlm_media_t *_p_media,
39 VLMStream::~VLMStream()
43 void VLMStream::Enable()
45 p_media->b_enabled = VLC_TRUE;
48 void VLMStream::Disable()
50 p_media->b_enabled = VLC_FALSE;
53 void VLMStream::Delete()
55 vlm_message_t *message;
56 string command = "del \"" + string( p_media->psz_name ) + "\"";
57 /* FIXME: Should be moved to vlm_Wrapper */
58 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
59 vlm_MessageDelete( message );
62 /*****************************************************************************
63 * VLMBroadcastStream class
64 *****************************************************************************/
65 VLMBroadcastStream::VLMBroadcastStream( intf_thread_t *_p_intf,
66 vlm_media_t *_p_media, VLMWrapper *_p_vlm ): VLMStream( _p_intf, _p_media, _p_vlm )
71 VLMBroadcastStream::~VLMBroadcastStream()
75 void VLMBroadcastStream::Play()
77 vlm_message_t *message;
78 string command = "control \"" + string( p_media->psz_name ) + "\" play";
79 /* FIXME: Should be moved to vlm_Wrapper */
80 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
81 vlm_MessageDelete( message );
84 void VLMBroadcastStream::Stop()
86 vlm_message_t *message;
87 string command = "control \"" + string( p_media->psz_name ) + "\" stop";
88 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
89 vlm_MessageDelete( message );
92 void VLMBroadcastStream::Pause()
94 vlm_message_t *message;
95 string command = "control \"" + string( p_media->psz_name ) + "\" pause";
96 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
97 vlm_MessageDelete( message );
100 /*****************************************************************************
102 *****************************************************************************/
103 VLMVODStream::VLMVODStream( intf_thread_t *_p_intf, vlm_media_t *_p_media,
104 VLMWrapper *_p_vlm ): VLMStream( _p_intf, _p_media, _p_vlm )
109 VLMVODStream::~VLMVODStream()