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 *****************************************************************************/
24 #include "dialogs/vlm/vlm_stream.hpp"
25 #include "dialogs/vlm/vlm_wrapper.hpp"
27 /*****************************************************************************
29 *****************************************************************************/
30 VLMStream::VLMStream( intf_thread_t *_p_intf, vlm_media_t *_p_media,
38 VLMStream::~VLMStream()
42 void VLMStream::Enable()
44 p_media->b_enabled = VLC_TRUE;
47 void VLMStream::Disable()
49 p_media->b_enabled = VLC_FALSE;
52 void VLMStream::Delete()
54 vlm_message_t *message;
55 string command = "del " + string( p_media->psz_name );
56 /* FIXME: Should be moved to vlm_Wrapper */
57 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
58 vlm_MessageDelete( message );
61 /*****************************************************************************
62 * VLMBroadcastStream class
63 *****************************************************************************/
64 VLMBroadcastStream::VLMBroadcastStream( intf_thread_t *_p_intf,
65 vlm_media_t *_p_media, VLMWrapper *_p_vlm ): VLMStream( _p_intf, _p_media, _p_vlm )
70 VLMBroadcastStream::~VLMBroadcastStream()
74 void VLMBroadcastStream::Play()
76 vlm_message_t *message;
77 string command = "control " + string( p_media->psz_name ) + " play";
78 /* FIXME: Should be moved to vlm_Wrapper */
79 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
80 vlm_MessageDelete( message );
83 void VLMBroadcastStream::Stop()
85 vlm_message_t *message;
86 string command = "control " + string( p_media->psz_name ) + " stop";
87 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
88 vlm_MessageDelete( message );
91 void VLMBroadcastStream::Pause()
93 vlm_message_t *message;
94 string command = "control " + string( p_media->psz_name ) + " pause";
95 vlm_ExecuteCommand( p_vlm->GetVLM(), (char*)command.c_str(), & message );
96 vlm_MessageDelete( message );
99 /*****************************************************************************
101 *****************************************************************************/
102 VLMVODStream::VLMVODStream( intf_thread_t *_p_intf, vlm_media_t *_p_media,
103 VLMWrapper *_p_vlm ): VLMStream( _p_intf, _p_media, _p_vlm )
108 VLMVODStream::~VLMVODStream()