Commit 8c74e8db authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Initial commit.

This is created from a 2011 GSoC project by Alexey Sokolov
https://wiki.videolan.org/SoC_2011/Generator_of_libVLC_bindings_for_other_languages/
parents
/*****************************************************************************
* libvlc_Audio.cpp: Audio implementation
*****************************************************************************
* Copyright © 2014 the VideoLAN team
*
* Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
*
* 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
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*****************************************************************************/
/* This file is autogenerated */
#include <vlc.hpp>
namespace VLC {
Audio::Audio(libvlc_media_player_t* obj)
{
if (!obj)
{
throw Exception("Can't construct Audio");
}
m_obj = obj;
}
Audio::Audio(const Audio& another)
{
m_obj = another.m_obj;
retain();
}
const Audio& Audio::operator=(const Audio& another)
{
if (this == &another)
{
return *this;
}
release();
m_obj = another.m_obj;
retain();
return *this;
}
bool Audio::operator==(const Audio& another) const
{
return m_obj == another.m_obj;
}
Audio::~Audio()
{
release();
}
void Audio::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)
{
libvlc_audio_set_callbacks(m_obj, play, pause, resume, flush, drain, opaque);
}
void Audio::setVolumeCallback(libvlc_audio_set_volume_cb set_volume)
{
libvlc_audio_set_volume_callback(m_obj, set_volume);
}
void Audio::setFormatCallbacks(libvlc_audio_setup_cb setup, libvlc_audio_cleanup_cb cleanup)
{
libvlc_audio_set_format_callbacks(m_obj, setup, cleanup);
}
void Audio::setFormat(const std::string& format, unsigned rate, unsigned channels)
{
libvlc_audio_set_format(m_obj, format.c_str(), rate, channels);
}
int Audio::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;
}
libvlc_audio_output_device_t * Audio::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;
}
void Audio::outputDeviceSet(const std::string& module, const std::string& device_id)
{
libvlc_audio_output_device_set(m_obj, module.c_str(), device_id.c_str());
}
void Audio::toggleMute()
{
libvlc_audio_toggle_mute(m_obj);
}
int Audio::mute()
{
int c_result = libvlc_audio_get_mute(m_obj);
int result = c_result;
return result;
}
void Audio::setMute(int status)
{
libvlc_audio_set_mute(m_obj, status);
}
int Audio::volume()
{
int c_result = libvlc_audio_get_volume(m_obj);
int result = c_result;
return result;
}
int Audio::setVolume(int i_volume)
{
int c_result = libvlc_audio_set_volume(m_obj, i_volume);
int result = c_result;
return result;
}
int Audio::trackCount()
{
int c_result = libvlc_audio_get_track_count(m_obj);
int result = c_result;
return result;
}
std::list<TrackDescription> Audio::trackDescription()
{
libvlc_track_description_t * c_result = libvlc_audio_get_track_description(m_obj);
std::list<TrackDescription> result = TrackDescription::makeList(c_result);
libvlc_track_description_list_release(c_result);
return result;
}
int Audio::track()
{
int c_result = libvlc_audio_get_track(m_obj);
int result = c_result;
return result;
}
int Audio::setTrack(int i_track)
{
int c_result = libvlc_audio_set_track(m_obj, i_track);
int result = c_result;
return result;
}
int Audio::channel()
{
int c_result = libvlc_audio_get_channel(m_obj);
int result = c_result;
return result;
}
int Audio::setChannel(int channel)
{
int c_result = libvlc_audio_set_channel(m_obj, channel);
int result = c_result;
return result;
}
int64_t Audio::delay()
{
int64_t c_result = libvlc_audio_get_delay(m_obj);
int64_t result = c_result;
return result;
}
int Audio::setDelay(int64_t i_delay)
{
int c_result = libvlc_audio_set_delay(m_obj, i_delay);
int result = c_result;
return result;
}
void Audio::retain() {
libvlc_media_player_retain(m_obj);
}
void Audio::release() {
libvlc_media_player_release(m_obj);
}
} // namespace VLC
This diff is collapsed.
/*****************************************************************************
* libvlc_Instance.cpp: Instance implementation
*****************************************************************************
* Copyright © 2014 the VideoLAN team
*
* Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
*
* 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
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*****************************************************************************/
/* This file is autogenerated */
#include <vlc.hpp>
namespace VLC {
Instance::Instance(libvlc_instance_t* obj)
{
if (!obj)
{
throw Exception("Can't construct Instance");
}
m_obj = obj;
}
Instance::Instance(const Instance& another)
{
m_obj = another.m_obj;
retain();
}
const Instance& Instance::operator=(const Instance& another)
{
if (this == &another)
{
return *this;
}
release();
m_obj = another.m_obj;
retain();
return *this;
}
bool Instance::operator==(const Instance& another) const
{
return m_obj == another.m_obj;
}
Instance::~Instance()
{
release();
}
Instance::Instance() {
m_obj = libvlc_new(0, NULL);
if (!m_obj) {
throw Exception();
}
}
Instance::Instance(int argc, const char *const * argv)
{
m_obj = libvlc_new(argc, argv);
if (!m_obj)
{
throw Exception("Can't construct Instance");
}
}
int Instance::addIntf(const std::string& name)
{
int c_result = libvlc_add_intf(m_obj, name.c_str());
int result = c_result;
return result;
}
void Instance::setExitHandler(void(*cb)(void *), void * opaque)
{
libvlc_set_exit_handler(m_obj, cb, opaque);
}
void Instance::wait()
{
libvlc_wait(m_obj);
}
void Instance::setUserAgent(const std::string& name, const std::string& http)
{
libvlc_set_user_agent(m_obj, name.c_str(), http.c_str());
}
void Instance::setAppId(const std::string& id, const std::string& version, const std::string& icon)
{
libvlc_set_app_id(m_obj, id.c_str(), version.c_str(), icon.c_str());
}
void Instance::logUnset()
{
libvlc_log_unset(m_obj);
}
void Instance::logSet(libvlc_log_cb cb, void * data)
{
libvlc_log_set(m_obj, cb, data);
}
void Instance::logSetFile(FILE * stream)
{
libvlc_log_set_file(m_obj, stream);
}
unsigned Instance::logVerbosity()
{
unsigned c_result = libvlc_get_log_verbosity(m_obj);
unsigned result = c_result;
return result;
}
void Instance::setLogVerbosity(unsigned level)
{
libvlc_set_log_verbosity(m_obj, level);
}
libvlc_log_t * Instance::logOpen()
{
libvlc_log_t * c_result = libvlc_log_open(m_obj);
libvlc_log_t * result = c_result;
return result;
}
std::list<ModuleDescription> Instance::audioFilterList()
{
libvlc_module_description_t * c_result = libvlc_audio_filter_list_get(m_obj);
std::list<ModuleDescription> result = ModuleDescription::makeList(c_result);
libvlc_module_description_list_release(c_result);
return result;
}
std::list<ModuleDescription> Instance::videoFilterList()
{
libvlc_module_description_t * c_result = libvlc_video_filter_list_get(m_obj);
std::list<ModuleDescription> result = ModuleDescription::makeList(c_result);
libvlc_module_description_list_release(c_result);
return result;
}
std::list<AudioOutputDescription> Instance::audioOutputList()
{
libvlc_audio_output_t * c_result = libvlc_audio_output_list_get(m_obj);
std::list<AudioOutputDescription> result = AudioOutputDescription::makeList(c_result);
libvlc_audio_output_list_release(c_result);
return result;
}
libvlc_audio_output_device_t * Instance::audioOutputDeviceList(const std::string& aout)
{
libvlc_audio_output_device_t * c_result = libvlc_audio_output_device_list_get(m_obj, aout.c_str());
libvlc_audio_output_device_t * result = c_result;
return result;
}
void Instance::release()
{
libvlc_release(m_obj);
}
void Instance::retain()
{
libvlc_retain(m_obj);
}
} // namespace VLC
This diff is collapsed.
/*****************************************************************************
* libvlc_Media.cpp: Media implementation
*****************************************************************************
* Copyright © 2014 the VideoLAN team
*
* Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
*
* 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
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*****************************************************************************/
/* This file is autogenerated */
#include <vlc.hpp>
namespace VLC {
Media::Media(libvlc_media_t* obj)
{
if (!obj)
{
throw Exception("Can't construct Media");
}
m_obj = obj;
}
Media::Media(const Media& another)
{
m_obj = another.m_obj;
retain();
}
const Media& Media::operator=(const Media& another)
{
if (this == &another)
{
return *this;
}
release();
m_obj = another.m_obj;
retain();
return *this;
}
bool Media::operator==(const Media& another) const
{
return m_obj == another.m_obj;
}
Media::~Media()
{
release();
}
Media::Media(Instance& inst, const std::string& s, ConstructorType t) {
m_obj = NULL;
switch (t) {
case Location:
m_obj = libvlc_media_new_location(inst.get_c_object(), s.c_str());
break;
case Path:
m_obj = libvlc_media_new_path(inst.get_c_object(), s.c_str());
break;
case Node:
m_obj = libvlc_media_new_as_node(inst.get_c_object(), s.c_str());
break;
}
if (!m_obj) {
throw Exception();
}
}
Media::Media(Instance & p_instance, const std::string& psz_mrl)
{
m_obj = libvlc_media_new_location(p_instance.get_c_object(), psz_mrl.c_str());
if (!m_obj)
{
throw Exception("Can't construct Media");
}
}
Media::Media(Instance & p_instance, int fd)
{
m_obj = libvlc_media_new_fd(p_instance.get_c_object(), fd);
if (!m_obj)
{
throw Exception("Can't construct Media");
}
}
Media::Media(MediaList & p_ml)
{
m_obj = libvlc_media_list_media(p_ml.get_c_object());
if (!m_obj)
{
throw Exception("Can't construct Media");
}
}
std::vector<MediaTrackInfo> Media::tracksInfo() {
libvlc_media_track_info_t* infos;
int num = libvlc_media_get_tracks_info(m_obj, &infos);
std::vector<MediaTrackInfo> result;
result.reserve(num);
for (int i = 0; i < num; ++i) {
result.push_back(MediaTrackInfo(infos+i));
}
libvlc_free(infos);
return result;
}
void Media::addOption(const std::string& psz_options)
{
libvlc_media_add_option(m_obj, psz_options.c_str());
}
void Media::addOptionFlag(const std::string& psz_options, unsigned i_flags)
{
libvlc_media_add_option_flag(m_obj, psz_options.c_str(), i_flags);
}
std::string Media::mrl()
{
char * c_result = libvlc_media_get_mrl(m_obj);
std::string result = c_result;
libvlc_free(c_result);
return result;
}
Media Media::duplicate()
{
libvlc_media_t * c_result = libvlc_media_duplicate(m_obj);
Media result = c_result;
return result;
}
std::string Media::meta(libvlc_meta_t e_meta)
{
char * c_result = libvlc_media_get_meta(m_obj, e_meta);
std::string result = c_result;
libvlc_free(c_result);
return result;
}
void Media::setMeta(libvlc_meta_t e_meta, const std::string& psz_value)
{
libvlc_media_set_meta(m_obj, e_meta, psz_value.c_str());
}
int Media::saveMeta()
{
int c_result = libvlc_media_save_meta(m_obj);
int result = c_result;
return result;
}
libvlc_state_t Media::state()
{
libvlc_state_t c_result = libvlc_media_get_state(m_obj);
libvlc_state_t result = c_result;
return result;
}
bool Media::stats(libvlc_media_stats_t * p_stats)
{
int c_result = libvlc_media_get_stats(m_obj, p_stats);
bool result = c_result;
return result;
}
libvlc_event_manager_t * Media::eventManager()
{
libvlc_event_manager_t * c_result = libvlc_media_event_manager(m_obj);
libvlc_event_manager_t * result = c_result;
return result;
}
libvlc_time_t Media::duration()
{
libvlc_time_t c_result = libvlc_media_get_duration(m_obj);
libvlc_time_t result = c_result;
return result;
}
void Media::parse()
{
libvlc_media_parse(m_obj);
}
void Media::parseAsync()
{
libvlc_media_parse_async(m_obj);
}
bool Media::isParsed()
{
int c_result = libvlc_media_is_parsed(m_obj);
bool result = c_result;
return result;
}
void Media::setUserData(void * p_new_user_data)
{
libvlc_media_set_user_data(m_obj, p_new_user_data);
}
void * Media::userData()
{
void * c_result = libvlc_media_get_user_data(m_obj);
void * result = c_result;
return result;
}
unsigned Media::tracks(libvlc_media_track_t *** tracks)
{
unsigned c_result = libvlc_media_tracks_get(m_obj, tracks);
unsigned result = c_result;
return result;
}
void Media::retain()
{
libvlc_media_retain(m_obj);
}
void Media::release()
{
libvlc_media_release(m_obj);
}
} // namespace VLC
This diff is collapsed.
/*****************************************************************************
* libvlc_MediaDiscoverer.cpp: MediaDiscoverer implementation
*****************************************************************************
* Copyright © 2014 the VideoLAN team
*
* Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
*
* 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
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*****************************************************************************/
/* This file is autogenerated */
#include <vlc.hpp>
namespace VLC {
MediaDiscoverer::MediaDiscoverer(libvlc_media_discoverer_t* obj)
{
if (!obj)
{
throw Exception("Can't construct MediaDiscoverer");
}
m_obj = obj;
m_own = true;
}
MediaDiscoverer::MediaDiscoverer(MediaDiscoverer&& another)
{
m_obj = another.m_obj;
m_own = another.m_own;
another.m_obj = NULL;
another.m_own = false;
}
const MediaDiscoverer& MediaDiscoverer::operator=(MediaDiscoverer&& another)
{
if (this == &another)
{
return *this;
}
if (m_own)
{
libvlc_media_discoverer_release(m_obj);
}
m_obj = another.m_obj;
m_own = another.m_own;
another.m_obj = NULL;
another.m_own = false;
return *this;
}
libvlc_media_discoverer_t* MediaDiscoverer::get_c_object()
{
return m_obj;
}
const libvlc_media_discoverer_t* MediaDiscoverer::get_c_object() const
{
return m_obj;
}
MediaDiscoverer::~MediaDiscoverer()
{
if (m_own)
{
libvlc_media_discoverer_release(m_obj);
}
}
MediaDiscoverer::MediaDiscoverer(Instance & p_inst, const std::string& psz_name)
{
m_obj = libvlc_media_discoverer_new_from_name(p_inst.get_c_object(), psz_name.c_str());
if (!m_obj)
{
throw Exception("Can't construct MediaDiscoverer");
}
m_own = true;
}
std::string MediaDiscoverer::localizedName()
{
char * c_result = libvlc_media_discoverer_localized_name(m_obj);
std::string result = c_result;
libvlc_free(c_result);
return result;
}