Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
volume.c
Package: vlc-1.0.5.zip [view]
Upload User: kjfoods
Upload Date: 2020-07-06
Package Size: 29949k
Code Size: 4k
Category:
midi program
Development Platform:
Unix_Linux
- /*****************************************************************************
- * volume.c
- *****************************************************************************
- * Copyright (C) 2007-2008 the VideoLAN team
- * $Id: 926046a5acd6a769ff4e2b2e1848ec3dd7cc2086 $
- *
- * Authors: Antoine Cellerier <dionoea at videolan tod org>
- * Pierre d'Herbemont <pdherbemont # videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
- /*****************************************************************************
- * Preamble
- *****************************************************************************/
- #ifndef _GNU_SOURCE
- # define _GNU_SOURCE
- #endif
- #ifdef HAVE_CONFIG_H
- # include "config.h"
- #endif
- #include <vlc_common.h>
- #include <vlc_plugin.h>
- #include <vlc_meta.h>
- #include <vlc_charset.h>
- #include <vlc_aout.h>
- #include <lua.h> /* Low level lua C API */
- #include <lauxlib.h> /* Higher level C API */
- #include <lualib.h> /* Lua libs */
- #include "../vlc.h"
- #include "../libs.h"
- #include "playlist.h"
- /*****************************************************************************
- * Volume related
- *****************************************************************************/
- static int vlclua_volume_set( lua_State *L )
- {
- playlist_t *p_this = vlclua_get_playlist_internal( L );
- int i_volume = luaL_checkint( L, 1 );
- /* Do we need to check that i_volume is in the AOUT_VOLUME_MIN->MAX range?*/
- int i_ret = aout_VolumeSet( p_this, i_volume );
- vlclua_release_playlist_internal( p_this );
- return vlclua_push_ret( L, i_ret );
- }
- static int vlclua_volume_get( lua_State *L )
- {
- audio_volume_t i_volume;
- playlist_t *p_this = vlclua_get_playlist_internal( L );
- if( aout_VolumeGet( p_this, &i_volume ) == VLC_SUCCESS )
- lua_pushnumber( L, i_volume );
- else
- lua_pushnil( L );
- vlclua_release_playlist_internal( p_this );
- return 1;
- }
- static int vlclua_volume_up( lua_State *L )
- {
- audio_volume_t i_volume;
- playlist_t *p_this = vlclua_get_playlist_internal( L );
- aout_VolumeUp( p_this, luaL_optint( L, 1, 1 ), &i_volume );
- lua_pushnumber( L, i_volume );
- vlclua_release_playlist_internal( p_this );
- return 1;
- }
- static int vlclua_volume_down( lua_State *L )
- {
- audio_volume_t i_volume;
- playlist_t *p_this = vlclua_get_playlist_internal( L );
- aout_VolumeDown( p_this, luaL_optint( L, 1, 1 ), &i_volume );
- lua_pushnumber( L, i_volume );
- vlclua_release_playlist_internal( p_this );
- return 1;
- }
- /*****************************************************************************
- *
- *****************************************************************************/
- static const luaL_Reg vlclua_volume_reg[] = {
- { "get", vlclua_volume_get },
- { "set", vlclua_volume_set },
- { "up", vlclua_volume_up },
- { "down", vlclua_volume_down },
- { NULL, NULL }
- };
- void luaopen_volume( lua_State *L )
- {
- lua_newtable( L );
- luaL_register( L, NULL, vlclua_volume_reg );
- lua_setfield( L, -2, "volume" );
- }