Commit 27645e33 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaPlayer: Remove unnecessary temporary variables

parent 4bd858b5
......@@ -4,6 +4,7 @@
* Copyright © 2014 the VideoLAN team
*
* Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
* Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
......@@ -20,13 +21,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/* This file is autogenerated */
#include <vlc.hpp>
namespace VLC {
namespace VLC
{
MediaPlayer::MediaPlayer(const MediaPlayer& another)
{
......@@ -77,32 +75,25 @@ void MediaPlayer::setMedia( Media& md )
libvlc_media_player_set_media( m_obj, md );
}
Media MediaPlayer::media()
Media* MediaPlayer::media()
{
libvlc_media_t * c_result = libvlc_media_player_get_media(m_obj);
Media result = c_result;
return result;
libvlc_media_t* media = libvlc_media_player_get_media(m_obj);
return new Media(media);
}
libvlc_event_manager_t * MediaPlayer::eventManager()
{
libvlc_event_manager_t * c_result = libvlc_media_player_event_manager(m_obj);
libvlc_event_manager_t * result = c_result;
return result;
return libvlc_media_player_event_manager(m_obj);
}
bool MediaPlayer::isPlaying()
{
int c_result = libvlc_media_player_is_playing(m_obj);
bool result = c_result;
return result;
return libvlc_media_player_is_playing(m_obj) != 0;
}
int MediaPlayer::play()
{
int c_result = libvlc_media_player_play(m_obj);
int result = c_result;
return result;
return libvlc_media_player_play(m_obj);
}
void MediaPlayer::setPause(int do_pause)
......@@ -127,9 +118,7 @@ void MediaPlayer::setNsobject(void * drawable)
void * MediaPlayer::nsobject()
{
void * c_result = libvlc_media_player_get_nsobject(m_obj);
void * result = c_result;
return result;
return libvlc_media_player_get_nsobject(m_obj);
}
void MediaPlayer::setAgl(uint32_t drawable)
......@@ -139,9 +128,7 @@ void MediaPlayer::setAgl(uint32_t drawable)
uint32_t MediaPlayer::agl()
{
uint32_t c_result = libvlc_media_player_get_agl(m_obj);
uint32_t result = c_result;
return result;
return libvlc_media_player_get_agl(m_obj);
}
void MediaPlayer::setXwindow(uint32_t drawable)
......@@ -151,9 +138,7 @@ void MediaPlayer::setXwindow(uint32_t drawable)
uint32_t MediaPlayer::xwindow()
{
uint32_t c_result = libvlc_media_player_get_xwindow(m_obj);
uint32_t result = c_result;
return result;
return libvlc_media_player_get_xwindow(m_obj);
}
void MediaPlayer::setHwnd(void * drawable)
......@@ -163,23 +148,17 @@ void MediaPlayer::setHwnd(void * drawable)
void * MediaPlayer::hwnd()
{
void * c_result = libvlc_media_player_get_hwnd(m_obj);
void * result = c_result;
return result;
return libvlc_media_player_get_hwnd(m_obj);
}
libvlc_time_t MediaPlayer::length()
{
libvlc_time_t c_result = libvlc_media_player_get_length(m_obj);
libvlc_time_t result = c_result;
return result;
return libvlc_media_player_get_length(m_obj);
}
libvlc_time_t MediaPlayer::time()
{
libvlc_time_t c_result = libvlc_media_player_get_time(m_obj);
libvlc_time_t result = c_result;
return result;
return libvlc_media_player_get_time(m_obj);
}
void MediaPlayer::setTime(libvlc_time_t i_time)
......@@ -189,9 +168,7 @@ void MediaPlayer::setTime(libvlc_time_t i_time)
float MediaPlayer::position()
{
float c_result = libvlc_media_player_get_position(m_obj);
float result = c_result;
return result;
return libvlc_media_player_get_position(m_obj);
}
void MediaPlayer::setPosition(float f_pos)
......@@ -206,30 +183,22 @@ void MediaPlayer::setChapter(int i_chapter)
int MediaPlayer::chapter()
{
int c_result = libvlc_media_player_get_chapter(m_obj);
int result = c_result;
return result;
return libvlc_media_player_get_chapter(m_obj);
}
int MediaPlayer::chapterCount()
{
int c_result = libvlc_media_player_get_chapter_count(m_obj);
int result = c_result;
return result;
return libvlc_media_player_get_chapter_count(m_obj);
}
bool MediaPlayer::willPlay()
{
int c_result = libvlc_media_player_will_play(m_obj);
bool result = c_result;
return result;
return libvlc_media_player_will_play(m_obj);
}
int MediaPlayer::chapterCountForTitle(int i_title)
{
int c_result = libvlc_media_player_get_chapter_count_for_title(m_obj, i_title);
int result = c_result;
return result;
return libvlc_media_player_get_chapter_count_for_title(m_obj, i_title);
}
void MediaPlayer::setTitle(int i_title)
......@@ -239,16 +208,12 @@ void MediaPlayer::setTitle(int i_title)
int MediaPlayer::title()
{
int c_result = libvlc_media_player_get_title(m_obj);
int result = c_result;
return result;
return libvlc_media_player_get_title(m_obj);
}
int MediaPlayer::titleCount()
{
int c_result = libvlc_media_player_get_title_count(m_obj);
int result = c_result;
return result;
return libvlc_media_player_get_title_count(m_obj);
}
void MediaPlayer::previousChapter()
......@@ -263,58 +228,42 @@ void MediaPlayer::nextChapter()
float MediaPlayer::rate()
{
float c_result = libvlc_media_player_get_rate(m_obj);
float result = c_result;
return result;
return libvlc_media_player_get_rate(m_obj);
}
int MediaPlayer::setRate(float rate)
{
int c_result = libvlc_media_player_set_rate(m_obj, rate);
int result = c_result;
return result;
return libvlc_media_player_set_rate(m_obj, rate);
}
libvlc_state_t MediaPlayer::state()
{
libvlc_state_t c_result = libvlc_media_player_get_state(m_obj);
libvlc_state_t result = c_result;
return result;
return libvlc_media_player_get_state(m_obj);
}
float MediaPlayer::fps()
{
float c_result = libvlc_media_player_get_fps(m_obj);
float result = c_result;
return result;
return libvlc_media_player_get_fps(m_obj);
}
unsigned MediaPlayer::hasVout()
{
unsigned c_result = libvlc_media_player_has_vout(m_obj);
unsigned result = c_result;
return result;
return libvlc_media_player_has_vout(m_obj);
}
bool MediaPlayer::isSeekable()
{
int c_result = libvlc_media_player_is_seekable(m_obj);
bool result = c_result;
return result;
return libvlc_media_player_is_seekable(m_obj);
}
bool MediaPlayer::canPause()
{
int c_result = libvlc_media_player_can_pause(m_obj);
bool result = c_result;
return result;
return libvlc_media_player_can_pause(m_obj);
}
bool MediaPlayer::programScrambled()
{
int c_result = libvlc_media_player_program_scrambled(m_obj);
bool result = c_result;
return result;
return libvlc_media_player_program_scrambled(m_obj);
}
void MediaPlayer::nextFrame()
......@@ -344,9 +293,7 @@ void MediaPlayer::setFullscreen(int b_fullscreen)
bool MediaPlayer::fullscreen()
{
int c_result = libvlc_get_fullscreen(m_obj);
bool result = c_result;
return result;
return libvlc_get_fullscreen(m_obj) != 0;
}
void MediaPlayer::toggleTeletext()
......@@ -356,9 +303,7 @@ void MediaPlayer::toggleTeletext()
int MediaPlayer::setEqualizer(libvlc_equalizer_t * p_equalizer)
{
int c_result = libvlc_media_player_set_equalizer(m_obj, p_equalizer);
int result = c_result;
return result;
return libvlc_media_player_set_equalizer(m_obj, p_equalizer);
}
void MediaPlayer::setCallbacks(libvlc_audio_play_cb play, libvlc_audio_pause_cb pause, libvlc_audio_resume_cb resume, libvlc_audio_flush_cb flush, libvlc_audio_drain_cb drain, void * opaque)
......@@ -383,16 +328,12 @@ void MediaPlayer::setFormat(const std::string& format, unsigned rate, unsigned c
int MediaPlayer::outputSet(const std::string& psz_name)
{
int c_result = libvlc_audio_output_set(m_obj, psz_name.c_str());
int result = c_result;
return result;
return libvlc_audio_output_set(m_obj, psz_name.c_str());
}
libvlc_audio_output_device_t * MediaPlayer::outputDeviceEnum()
{
libvlc_audio_output_device_t * c_result = libvlc_audio_output_device_enum(m_obj);
libvlc_audio_output_device_t * result = c_result;
return result;
return libvlc_audio_output_device_enum(m_obj);
}
void MediaPlayer::outputDeviceSet(const std::string& module, const std::string& device_id)
......@@ -407,9 +348,7 @@ void MediaPlayer::toggleMute()
int MediaPlayer::mute()
{
int c_result = libvlc_audio_get_mute(m_obj);
int result = c_result;
return result;
return libvlc_audio_get_mute(m_obj);
}
void MediaPlayer::setMute(int status)
......@@ -419,23 +358,17 @@ void MediaPlayer::setMute(int status)
int MediaPlayer::volume()
{
int c_result = libvlc_audio_get_volume(m_obj);
int result = c_result;
return result;
return libvlc_audio_get_volume(m_obj);
}
int MediaPlayer::setVolume(int i_volume)
{
int c_result = libvlc_audio_set_volume(m_obj, i_volume);
int result = c_result;
return result;
return libvlc_audio_set_volume(m_obj, i_volume);
}
int MediaPlayer::audioTrackCount()
{
int c_result = libvlc_audio_get_track_count(m_obj);
int result = c_result;
return result;
return libvlc_audio_get_track_count(m_obj);
}
std::vector<TrackDescription> MediaPlayer::audioTrackDescription()
......@@ -446,44 +379,32 @@ std::vector<TrackDescription> MediaPlayer::audioTrackDescription()
int MediaPlayer::audioTrack()
{
int c_result = libvlc_audio_get_track(m_obj);
int result = c_result;
return result;
return libvlc_audio_get_track(m_obj);
}
int MediaPlayer::setAudioTrack(int i_track)
{
int c_result = libvlc_audio_set_track(m_obj, i_track);
int result = c_result;
return result;
return libvlc_audio_set_track(m_obj, i_track);
}
int MediaPlayer::channel()
{
int c_result = libvlc_audio_get_channel(m_obj);
int result = c_result;
return result;
return libvlc_audio_get_channel(m_obj);
}
int MediaPlayer::setChannel(int channel)
{
int c_result = libvlc_audio_set_channel(m_obj, channel);
int result = c_result;
return result;
return libvlc_audio_set_channel(m_obj, channel);
}
int64_t MediaPlayer::delay()
{
int64_t c_result = libvlc_audio_get_delay(m_obj);
int64_t result = c_result;
return result;
return libvlc_audio_get_delay(m_obj);
}
int MediaPlayer::setDelay(int64_t i_delay)
{
int c_result = libvlc_audio_set_delay(m_obj, i_delay);
int result = c_result;
return result;
return libvlc_audio_set_delay(m_obj, i_delay);
}
void MediaPlayer::setCallbacks(libvlc_video_lock_cb lock, libvlc_video_unlock_cb unlock, libvlc_video_display_cb display, void * opaque)
......@@ -513,23 +434,17 @@ void MediaPlayer::setMouseInput(unsigned on)
int MediaPlayer::size(unsigned num, unsigned * px, unsigned * py)
{
int c_result = libvlc_video_get_size(m_obj, num, px, py);
int result = c_result;
return result;
return libvlc_video_get_size(m_obj, num, px, py);
}
int MediaPlayer::cursor(unsigned num, int * px, int * py)
{
int c_result = libvlc_video_get_cursor(m_obj, num, px, py);
int result = c_result;
return result;
return libvlc_video_get_cursor(m_obj, num, px, py);
}
float MediaPlayer::scale()
{
float c_result = libvlc_video_get_scale(m_obj);
float result = c_result;
return result;
return libvlc_video_get_scale(m_obj);
}
void MediaPlayer::setScale(float f_factor)
......@@ -552,16 +467,12 @@ void MediaPlayer::setAspectRatio(const std::string& psz_aspect)
int MediaPlayer::spu()
{
int c_result = libvlc_video_get_spu(m_obj);
int result = c_result;
return result;
return libvlc_video_get_spu(m_obj);
}
int MediaPlayer::spuCount()
{
int c_result = libvlc_video_get_spu_count(m_obj);
int result = c_result;
return result;
return libvlc_video_get_spu_count(m_obj);
}
std::vector<TrackDescription> MediaPlayer::spuDescription()
......@@ -572,30 +483,22 @@ std::vector<TrackDescription> MediaPlayer::spuDescription()
int MediaPlayer::setSpu(int i_spu)
{
int c_result = libvlc_video_set_spu(m_obj, i_spu);
int result = c_result;
return result;
return libvlc_video_set_spu(m_obj, i_spu);
}
int MediaPlayer::setSubtitleFile(const std::string& psz_subtitle)
{
int c_result = libvlc_video_set_subtitle_file(m_obj, psz_subtitle.c_str());
int result = c_result;
return result;
return libvlc_video_set_subtitle_file(m_obj, psz_subtitle.c_str());
}
int64_t MediaPlayer::spuDelay()
{
int64_t c_result = libvlc_video_get_spu_delay(m_obj);
int64_t result = c_result;
return result;
return libvlc_video_get_spu_delay(m_obj);
}
int MediaPlayer::setSpuDelay(int64_t i_delay)
{
int c_result = libvlc_video_set_spu_delay(m_obj, i_delay);
int result = c_result;
return result;
return libvlc_video_set_spu_delay(m_obj, i_delay);
}
std::vector<TrackDescription> MediaPlayer::titleDescription()
......@@ -625,9 +528,7 @@ void MediaPlayer::setCropGeometry(const std::string& psz_geometry)
int MediaPlayer::teletext()
{
int c_result = libvlc_video_get_teletext(m_obj);
int result = c_result;
return result;
return libvlc_video_get_teletext(m_obj);
}
void MediaPlayer::setTeletext(int i_page)
......@@ -637,9 +538,7 @@ void MediaPlayer::setTeletext(int i_page)
int MediaPlayer::videoTrackCount()
{
int c_result = libvlc_video_get_track_count(m_obj);
int result = c_result;
return result;
return libvlc_video_get_track_count(m_obj);
}
std::vector<TrackDescription> MediaPlayer::videoTrackDescription()
......@@ -650,23 +549,17 @@ std::vector<TrackDescription> MediaPlayer::videoTrackDescription()
int MediaPlayer::videoTrack()
{
int c_result = libvlc_video_get_track(m_obj);
int result = c_result;
return result;
return libvlc_video_get_track(m_obj);
}
int MediaPlayer::setVideoTrack(int i_track)
{
int c_result = libvlc_video_set_track(m_obj, i_track);
int result = c_result;
return result;
return libvlc_video_set_track(m_obj, i_track);
}
int MediaPlayer::takeSnapshot(unsigned num, const std::string& psz_filepath, unsigned int i_width, unsigned int i_height)
{
int c_result = libvlc_video_take_snapshot(m_obj, num, psz_filepath.c_str(), i_width, i_height);
int result = c_result;
return result;
return libvlc_video_take_snapshot(m_obj, num, psz_filepath.c_str(), i_width, i_height);
}
void MediaPlayer::setDeinterlace(const std::string& psz_mode)
......@@ -676,9 +569,7 @@ void MediaPlayer::setDeinterlace(const std::string& psz_mode)
int MediaPlayer::marqueeInt(unsigned option)
{
int c_result = libvlc_video_get_marquee_int(m_obj, option);
int result = c_result;
return result;
return libvlc_video_get_marquee_int(m_obj, option);
}
std::string MediaPlayer::marqueeString(unsigned option)
......@@ -701,9 +592,7 @@ void MediaPlayer::setMarqueeString(unsigned option, const std::string& psz_text)
int MediaPlayer::logoInt(unsigned option)
{
int c_result = libvlc_video_get_logo_int(m_obj, option);
int result = c_result;
return result;
return libvlc_video_get_logo_int(m_obj, option);
}
void MediaPlayer::setLogoInt(unsigned option, int value)
......@@ -718,9 +607,7 @@ void MediaPlayer::setLogoString(unsigned option, const std::string& psz_value)
int MediaPlayer::adjustInt(unsigned option)
{
int c_result = libvlc_video_get_adjust_int(m_obj, option);
int result = c_result;
return result;
return libvlc_video_get_adjust_int(m_obj, option);
}
void MediaPlayer::setAdjustInt(unsigned option, int value)
......
......@@ -4,6 +4,7 @@
* Copyright © 2014 the VideoLAN team
*
* Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
* Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
......@@ -20,10 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/* This file is autogenerated */
#ifndef LIBVLC_CXX_MEDIAPLAYER_H
#define LIBVLC_CXX_MEDIAPLAYER_H
......@@ -90,7 +87,7 @@ public:
* \return the media associated with p_mi, or NULL if no media is
* associated
*/
Media media();
Media* media();
/**
* Get the Event Manager from which the media player send event.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment