Skip to content

Commit

Permalink
Don't use pointers for basic C++ variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadej committed Aug 30, 2013
1 parent d735701 commit 046e1c4
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ release/
*.DS_Store*

# Project files
CMakeLists.txt.user
demo-player.pro.user
CMakeLists.txt.user*
demo-player.pro.user*

# Debian/build
obj*
4 changes: 2 additions & 2 deletions src/core/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool VlcAudio::getMute() const
return mute;
}

void VlcAudio::setVolume(const int &volume)
void VlcAudio::setVolume(int volume)
{
if (_vlcMediaPlayer) {
// Don't change if volume is the same
Expand All @@ -50,7 +50,7 @@ void VlcAudio::setVolume(const int &volume)
}
}

void VlcAudio::setTrack(const int &track)
void VlcAudio::setTrack(int track)
{
if (_vlcMediaPlayer) {
libvlc_audio_set_track(_vlcMediaPlayer, track);
Expand Down
4 changes: 2 additions & 2 deletions src/core/Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ Q_OBJECT
\brief Set current audio level.
\param volume new audio level (int)
*/
void setVolume(const int &volume);
void setVolume(int volume);

/*!
\brief Set current audio track.
\param track new audio track (int)
*/
void setTrack(const int &track);
void setTrack(int track);

/*!
\brief Toggle mute status.
Expand Down
22 changes: 11 additions & 11 deletions src/core/Media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "core/Media.h"

VlcMedia::VlcMedia(const QString &location,
const bool &localFile,
bool localFile,
VlcInstance *instance)
: QObject(instance)
{
Expand Down Expand Up @@ -62,7 +62,7 @@ libvlc_media_t *VlcMedia::core()
}

void VlcMedia::initMedia(const QString &location,
const bool &localFile,
bool localFile,
VlcInstance *instance)
{
_currentLocation = location;
Expand Down Expand Up @@ -143,9 +143,9 @@ QString VlcMedia::duplicate(const QString &name,
const Vlc::Mux &mux,
const Vlc::AudioCodec &audioCodec,
const Vlc::VideoCodec &videoCodec,
const int &bitrate,
const int &fps,
const int &scale)
int bitrate,
int fps,
int scale)
{
return record(name, path, mux, audioCodec, videoCodec, bitrate, fps, scale, true);
}
Expand Down Expand Up @@ -178,7 +178,7 @@ QString VlcMedia::merge(const QString &name,
QString VlcMedia::record(const QString &name,
const QString &path,
const Vlc::Mux &mux,
const bool &duplicate)
bool duplicate)
{
QString option1, option2, parameters;
QString l = path + "/" + name;
Expand Down Expand Up @@ -211,7 +211,7 @@ QString VlcMedia::record(const QString &name,
const Vlc::Mux &mux,
const Vlc::AudioCodec &audioCodec,
const Vlc::VideoCodec &videoCodec,
const bool &duplicate)
bool duplicate)
{
QString option1, option2, parameters;
QString l = path + "/" + name;
Expand Down Expand Up @@ -244,10 +244,10 @@ QString VlcMedia::record(const QString &name,
const Vlc::Mux &mux,
const Vlc::AudioCodec &audioCodec,
const Vlc::VideoCodec &videoCodec,
const int &bitrate,
const int &fps,
const int &scale,
const bool &duplicate)
int bitrate,
int fps,
int scale,
bool duplicate)
{
QString option1, option2, parameters;
QString l = path + "/" + name;
Expand Down
26 changes: 13 additions & 13 deletions src/core/Media.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Q_OBJECT
\param instance main libvlc instance (VlcInstance *)
*/
explicit VlcMedia(const QString &location,
const bool &localFile,
bool localFile,
VlcInstance *instance);

/*!
Expand Down Expand Up @@ -151,9 +151,9 @@ Q_OBJECT
const Vlc::Mux &mux,
const Vlc::AudioCodec &audioCodec,
const Vlc::VideoCodec &videoCodec,
const int &bitrate,
const int &fps,
const int &scale);
int bitrate,
int fps,
int scale);


/*!
Expand Down Expand Up @@ -184,7 +184,7 @@ Q_OBJECT
QString record(const QString &name,
const QString &path,
const Vlc::Mux &mux,
const bool &duplicate = false);
bool duplicate = false);

/*!
\brief Record
Expand All @@ -204,7 +204,7 @@ Q_OBJECT
const Vlc::Mux &mux,
const Vlc::AudioCodec &audioCodec,
const Vlc::VideoCodec &videoCodec,
const bool &duplicate = false);
bool duplicate = false);

/*!
\brief Record
Expand All @@ -228,10 +228,10 @@ Q_OBJECT
const Vlc::Mux &mux,
const Vlc::AudioCodec &audioCodec,
const Vlc::VideoCodec &videoCodec,
const int &bitrate,
const int &fps,
const int &scale,
const bool &duplicate = false);
int bitrate,
int fps,
int scale,
bool duplicate = false);

/*!
\brief Set media option
Expand Down Expand Up @@ -269,13 +269,13 @@ Q_OBJECT
\brief Signal sent on duration change
\param int duration
*/
void durationChanged(const int &);
void durationChanged(int);

/*!
\brief Signal sent on parsed change
\param int status
*/
void parsedChanged(const int &);
void parsedChanged(int);

/*!
\brief Signal sent on freed
Expand All @@ -292,7 +292,7 @@ Q_OBJECT

private:
void initMedia(const QString &location,
const bool &localFile,
bool localFile,
VlcInstance *instance);

static void libvlc_callback(const libvlc_event_t *event,
Expand Down
6 changes: 3 additions & 3 deletions src/core/MediaList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void VlcMediaList::addMedia(VlcMedia *media)
VlcError::errmsg();
}

VlcMedia *VlcMediaList::at(const int &index)
VlcMedia *VlcMediaList::at(int index)
{
return _list[index];
}
Expand Down Expand Up @@ -121,7 +121,7 @@ int VlcMediaList::indexOf(libvlc_media_t *media)
}

void VlcMediaList::insertMedia(VlcMedia *media,
const int &index)
int index)
{
lock();
libvlc_media_list_insert_media(_vlcMediaList, media->core(), index);
Expand All @@ -131,7 +131,7 @@ void VlcMediaList::insertMedia(VlcMedia *media,
VlcError::errmsg();
}

void VlcMediaList::removeMedia(const int &index)
void VlcMediaList::removeMedia(int index)
{
lock();
libvlc_media_list_remove_index(_vlcMediaList, index);
Expand Down
14 changes: 7 additions & 7 deletions src/core/MediaList.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Q_OBJECT
\param index item position
\return media item (VlcMedia)
*/
VlcMedia *at(const int &index);
VlcMedia *at(int index);

/*!
\brief libvlc media list item
Expand Down Expand Up @@ -103,13 +103,13 @@ Q_OBJECT
\param index item position
*/
void insertMedia(VlcMedia *media,
const int &index);
int index);

/*!
\brief Remove media item from the specific position of the list.
\param index item position
*/
void removeMedia(const int &index);
void removeMedia(int index);


signals:
Expand All @@ -119,31 +119,31 @@ Q_OBJECT
\param int index
*/
void itemAdded(libvlc_media_t *,
const int &);
int);

/*!
\brief Signal sent when item will be added
\param libvlc_media_t * item
\param int index
*/
void willAddItem(libvlc_media_t *,
const int &);
int);

/*!
\brief Signal sent on item deleted
\param libvlc_media_t * item
\param int index
*/
void itemDeleted(libvlc_media_t *,
const int &);
int);

/*!
\brief Signal sent when item will be deleted
\param libvlc_media_t * item
\param int index
*/
void willDeleteItem(libvlc_media_t *,
const int &);
int);


private:
Expand Down
3 changes: 2 additions & 1 deletion src/core/MediaListPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ VlcMediaListPlayer::VlcMediaListPlayer(VlcMediaPlayer *player,
_player = player;

_vlcMediaListPlayer = libvlc_media_list_player_new(instance->core());
_vlcEvents = libvlc_media_list_player_event_manager(_vlcMediaListPlayer);
libvlc_media_list_player_set_media_player(_vlcMediaListPlayer, _player->core());

createCoreConnections();
Expand Down Expand Up @@ -106,7 +107,7 @@ void VlcMediaListPlayer::removeCoreConnections()
}
}

void VlcMediaListPlayer::itemAt(const int &index)
void VlcMediaListPlayer::itemAt(int index)
{
libvlc_media_list_player_play_item_at_index(_vlcMediaListPlayer, index);

Expand Down
2 changes: 1 addition & 1 deletion src/core/MediaListPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public slots:
\brief Starts playing item at specific position.
\param index item position
*/
void itemAt(const int &index);
void itemAt(int index);

/*!
\brief Starts playing next item in the list.
Expand Down
4 changes: 2 additions & 2 deletions src/core/MediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void VlcMediaPlayer::resume()
VlcError::errmsg();
}

void VlcMediaPlayer::setTime(const int &time)
void VlcMediaPlayer::setTime(int time)
{
libvlc_media_player_set_time(_vlcMediaPlayer, time);

Expand Down Expand Up @@ -381,7 +381,7 @@ float VlcMediaPlayer::position()
return libvlc_media_player_get_position(_vlcMediaPlayer);
}

void VlcMediaPlayer::setPosition(const float &pos)
void VlcMediaPlayer::setPosition(float pos)
{
libvlc_media_player_set_position(_vlcMediaPlayer, pos);

Expand Down
Loading

0 comments on commit 046e1c4

Please sign in to comment.