• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KMediaPlayer

  • sources
  • kde-4.12
  • kdelibs
  • interfaces
  • kmediaplayer
player.cpp
Go to the documentation of this file.
1 // Copyright (C) 2002 Neil Stevens <neil@qualityassistant.com>
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
17 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18 // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Except as contained in this notice, the name(s) of the author(s) shall not be
21 // used in advertising or otherwise to promote the sale, use or other dealings
22 // in this Software without prior written authorization from the author(s).
23 
24 #include <kmediaplayer/player.h>
25 #include <kmediaplayer/kmediaplayeradaptor_p.h>
26 
27 KMediaPlayer::Player::Player(QWidget *, const char *, QObject *parent)
28  : KParts::ReadOnlyPart(parent)
29  , currentLooping(false)
30  , currentState(Empty)
31  , d(0)
32 {
33  (void)new KMediaPlayerAdaptor(this);
34 }
35 
36 KMediaPlayer::Player::Player(QObject *parent )
37  : KParts::ReadOnlyPart(parent)
38  , currentLooping(false)
39  , currentState(Empty)
40  , d(0)
41 {
42  (void)new KMediaPlayerAdaptor(this);
43 }
44 
45 KMediaPlayer::Player::~Player(void)
46 {
47 }
48 
49 void KMediaPlayer::Player::setLooping(bool b)
50 {
51  if(b != currentLooping)
52  {
53  currentLooping = b;
54  emit loopingChanged(b);
55  }
56 }
57 
58 bool KMediaPlayer::Player::isLooping(void) const
59 {
60  return currentLooping;
61 }
62 
63 void KMediaPlayer::Player::setState(int s)
64 {
65  if(s != currentState)
66  {
67  currentState = (State)s;
68  emit stateChanged(s);
69  }
70 }
71 
72 int KMediaPlayer::Player::state(void) const
73 {
74  return (int)currentState;
75 }
76 
77 #include "player.moc"
KMediaPlayer::Player::~Player
virtual ~Player(void)
Definition: player.cpp:45
KMediaPlayer::Player::state
int state(void) const
Return the current state of the player.
Definition: player.cpp:72
QWidget
KMediaPlayerAdaptor
Definition: kmediaplayeradaptor_p.h:22
QObject
player.h
KMediaPlayer::Player::Player
Player(QObject *parent)
This constructor is what to use when no GUI is required, as in the case of a KMediaPlayer/Engine.
Definition: player.cpp:36
KMediaPlayer::Player::isLooping
bool isLooping(void) const
Return the current looping state.
Definition: player.cpp:58
kmediaplayeradaptor_p.h
KMediaPlayer::Player::setState
void setState(int)
Implementers use this to control what users see as the current state.
Definition: player.cpp:63
KMediaPlayer::Player::setLooping
void setLooping(bool)
Set whether the Player should continue playing at the beginning of the track when the end of the trac...
Definition: player.cpp:49
KMediaPlayer::Player::State
State
The possible states of the Player.
Definition: player.h:116
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMediaPlayer

Skip menu "KMediaPlayer"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal