]> git.sesse.net Git - vlc/blob - modules/gui/skins2/commands/cmd_voutwindow.cpp
skins2: differentiate new and release window commands
[vlc] / modules / gui / skins2 / commands / cmd_voutwindow.cpp
1 /*****************************************************************************
2  * cmd_voutwindow.cpp
3  *****************************************************************************
4  * Copyright (C) 2009 the VideoLAN team
5  * $Id$
6  *
7  * Author: Erwan Tulou      <erwan10 aT videolan doT org >
8  *
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.
13  *
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.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "cmd_voutwindow.hpp"
25 #include "../src/vout_manager.hpp"
26 #include "../src/vout_window.hpp"
27
28
29 CmdNewVoutWindow::CmdNewVoutWindow( intf_thread_t *pIntf, vout_window_t* pWnd )
30     : CmdGeneric( pIntf ), m_pWnd( pWnd ) { }
31
32
33 void CmdNewVoutWindow::execute()
34 {
35     intf_sys_t *p_sys = getIntf()->p_sys;
36
37     vlc_mutex_lock( &p_sys->vout_lock );
38
39     p_sys->handle = p_sys->p_voutManager->acceptWnd( m_pWnd );
40     p_sys->b_vout_ready = true;
41     vlc_cond_signal( &p_sys->vout_wait );
42
43     vlc_mutex_unlock( &p_sys->vout_lock );
44 }
45
46
47 CmdReleaseVoutWindow::CmdReleaseVoutWindow( intf_thread_t *pIntf,
48                                             vout_window_t* pWnd )
49     : CmdGeneric( pIntf ), m_pWnd( pWnd ) { }
50
51
52 void CmdReleaseVoutWindow::execute()
53 {
54     intf_sys_t *p_sys = getIntf()->p_sys;
55
56     vlc_mutex_lock( &p_sys->vout_lock );
57
58     p_sys->p_voutManager->releaseWnd( m_pWnd );
59     p_sys->b_vout_ready = true;
60     vlc_cond_signal( &p_sys->vout_wait );
61
62     vlc_mutex_unlock( &p_sys->vout_lock );
63 }
64
65