Commit 3f535ebd authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Make all object constructors explicit

parent 5fd9466c
......@@ -128,13 +128,13 @@ void EventManager::handleMediaEvent(const libvlc_event_t* event, void* data)
cb->parsedChanged( event->u.media_parsed_changed.new_status );
break;
case libvlc_MediaFreed:
cb->freed( event->u.media_freed.md );
cb->freed( Media( event->u.media_freed.md ) );
break;
case libvlc_MediaStateChanged:
cb->stateChanged( event->u.media_state_changed.new_state );
break;
case libvlc_MediaSubItemTreeAdded:
cb->subItemTreeAdded( event->u.media_subitemtree_added.item );
cb->subItemTreeAdded( Media( event->u.media_subitemtree_added.item ) );
break;
default:
assert(false);
......
......@@ -242,7 +242,7 @@ public:
std::vector<AudioOutputDeviceDescription> audioOutputDeviceList(const std::string& aout);
private:
Instance(InternalPtr ptr);
explicit Instance(InternalPtr ptr);
/**
* Decrement the reference count of a libvlc instance, and destroy it if
* it reaches zero.
......
......@@ -120,7 +120,8 @@ std::string Media::mrl()
Media Media::duplicate()
{
return libvlc_media_duplicate(m_obj);
InternalPtr obj = libvlc_media_duplicate(m_obj);
return Media( obj );
}
std::string Media::meta(libvlc_meta_t e_meta)
......
......@@ -329,7 +329,7 @@ public:
std::vector<MediaTrack> tracks();
private:
Media(InternalPtr ptr);
explicit Media(InternalPtr ptr);
/**
* Retain a reference to a media descriptor object (libvlc_media_t). Use
* Media::release() to decrement the reference count of a media
......
......@@ -69,7 +69,7 @@ public:
bool isRunning();
private:
MediaDiscoverer(InternalPtr ptr);
explicit MediaDiscoverer(InternalPtr ptr);
/**
* Release media discover object. If the reference count reaches 0, then
* the object will be released.
......
......@@ -69,7 +69,7 @@ public:
int load();
private:
MediaLibrary(InternalPtr ptr);
explicit MediaLibrary(InternalPtr ptr);
/**
* Release media library object. This functions decrements the reference
* count of the media library object. If it reaches 0, then the object
......
......@@ -192,7 +192,7 @@ public:
VLC::EventManager& eventManager();
private:
MediaList(InternalPtr ptr);
explicit MediaList(InternalPtr ptr);
/**
* Release media list created with MediaList::MediaList() .
*/
......
......@@ -159,7 +159,7 @@ public:
void setPlaybackMode(libvlc_playback_mode_t e_mode);
private:
MediaListPlayer(InternalPtr ptr);
explicit MediaListPlayer(InternalPtr ptr);
/**
* Release a media_list_player after use Decrement the reference count of
* a media player object. If the reference count is 0, then
......
......@@ -1210,7 +1210,7 @@ public:
void setAdjustFloat(unsigned option, float value);
private:
MediaPlayer( InternalPtr ptr );
explicit MediaPlayer( InternalPtr ptr );
/**
* Release a media_player after use Decrement the reference count of a
* media player object. If the reference count is 0, then
......
......@@ -24,6 +24,8 @@
#ifndef LIBVLC_CXX_STRUCTURES_H
#define LIBVLC_CXX_STRUCTURES_H
#include <string>
#include "common.hpp"
namespace VLC
......@@ -41,7 +43,7 @@ public:
const std::string& help() const;
private:
ModuleDescription( libvlc_module_description_t* c );
explicit ModuleDescription( libvlc_module_description_t* c );
std::string m_name;
std::string m_shortname;
std::string m_longname;
......@@ -82,7 +84,7 @@ public:
const std::string& encoding() const;
private:
MediaTrack(libvlc_media_track_t* c);
explicit MediaTrack(libvlc_media_track_t* c);
uint32_t m_codec;
uint32_t m_originalFourcc;
......@@ -130,7 +132,7 @@ class VLCPP_API AudioOutputDeviceDescription
const std::string& description() const;
private:
AudioOutputDeviceDescription( libvlc_audio_output_device_t* d );
explicit AudioOutputDeviceDescription( libvlc_audio_output_device_t* d );
std::string m_device;
std::string m_description;
......@@ -146,7 +148,7 @@ public:
const std::string& name() const;
private:
TrackDescription( libvlc_track_description_t* c );
explicit TrackDescription( libvlc_track_description_t* c );
int m_id;
std::string m_name;
......
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