#include <track.hpp>
| void AL::Track::abort |
( |
| ) |
|
Stop the stream with clipping the end of the output buffer. (faster as possible, but can have some audio artefact)
- Note
- do nothing if the playing is not active.
- Exceptions
-
| std::runtime_error | If an error occured. |
| float AL::Track::getBalance |
( |
| ) |
const |
Get the current Balance of the Track.
- Returns
- Balance value -1..1.
| qi::Duration AL::Track::getDuration |
( |
| ) |
const |
Total duration of the file find in the header property.
- Returns
- The file Duration [0 .. inf]
| qi::Duration AL::Track::getFadeIn |
( |
| ) |
const |
Get the current fade-in. The fade-in is apply all time (although in the start of the file)
- Returns
- Time fade-in [0..20second]
| qi::Duration AL::Track::getFadeOut |
( |
| ) |
const |
Get the current fade-out.
- Returns
- Time fade-out [0..20second]
| std::string AL::Track::getFileName |
( |
| ) |
const |
Get the current file name that might be read.
- Returns
- Current set filename
| enum trackState AL::Track::getIdleState |
( |
| ) |
const |
Get the Idle state of the Tack.
- Returns
- The current request: "STOP", "PRELOAD" or "SUSPEND".
| qi::SteadyClock::time_point AL::Track::getPosition |
( |
| ) |
const |
Get the Current position of the playing track.
- Returns
- The position in millisecond [0..getDuration()]
| enum trackState AL::Track::getState |
( |
| ) |
const |
Get state of the internal system:
- Returns
- the current track state
| float AL::Track::getVolume |
( |
| ) |
const |
Get the current playing volume in dB.
- Returns
- Volume value [-50..0]
| float AL::Track::getVolumePercent |
( |
| ) |
const |
Get the current playing volume in %.
- Returns
- Volume value [0..100]
| bool AL::Track::isPlaying |
( |
| ) |
|
Check if track is currently playing.
- Returns
- true if playing is in progress
| void AL::Track::pause |
( |
| ) |
|
Suspend the Current playing.
- Note
- do nothing if the playing is not active.
- Exceptions
-
| std::runtime_error | If an error occured. |
Start generating an output.
- Note
- this function done everything is needed for the playing of the file. When return the audio hardware will be started
-
this function is faster if the setIdleState(AL::trackEvent_suspend) is done.
- Exceptions
-
| std::runtime_error | If file does not exist. |
| std::runtime_error | If file is not set. |
| std::runtime_error | If an error occured. |
| void AL::Track::seek |
( |
const qi::SteadyClock::time_point & |
pos | ) |
|
Seek to a specify position in the file.
- Parameters
-
- Note
- This is a synchronous function (return only when seeking is done or have an error)
| void AL::Track::setBalance |
( |
float |
balance | ) |
|
Set the current Balance of the Playing file.
- Parameters
-
| [in] | balance | Balance value -1..1. |
| void AL::Track::setFadeIn |
( |
const qi::Duration & |
fadeTime | ) |
|
Set the file fade-in.
- Parameters
-
| [in] | fadeTime | Time fade-in [0..2000] |
| void AL::Track::setFadeOut |
( |
const qi::Duration & |
fadeTime | ) |
|
Set the file fade-out.
- Note
- The fade-out is temporized of the buffering of the Pulse-audio interface (500ms before applying it)
- Parameters
-
| [in] | fadeTime | Time fade-out [0..20second] |
| void AL::Track::setFileName |
( |
const std::string & |
filename | ) |
|
Set the current file name to read.
- Parameters
-
| [in] | filename | File name to read |
| void AL::Track::setIdleState |
( |
enum trackState |
state | ) |
|
Set the idle state of the Tack.
- Parameters
-
| [in] | state | Idle state requested: trackState_stopped just an empty track instance. trackState_preload Le file ss loaded and the already parsed. trackState_suspend The harware interface is ready and wait for playing. |
- Note
- If the track is playing it do nothing if the file is in stop mode, it can change the state of the track.
- Exceptions
-
| std::runtime_error | If unknow state. |
| void AL::Track::setVolume |
( |
float |
volume | ) |
|
Set the current volume of the player in dB.
- Parameters
-
| [in] | volume | Volume to set [-50..0] |
| void AL::Track::setVolumePercent |
( |
float |
volume | ) |
|
Set the current volume of the player in %.
- Parameters
-
| [in] | volume | Volume to set [0..100] |
Stop the current playing with draining the current sample in the output.
- Note
- do nothing if the playing is not active.
- Exceptions
-
| std::runtime_error | If an error occured. |
| qi::Signal<qi::SteadyClock::time_point> AL::Track::signalPosition |
Generate the current playing time, emited every 0.1s.
- Returns
- [0..getDuration()]
| qi::Signal<enum trackEvent> AL::Track::statusChange |
Event generated when status of the track change.
- See Also
- AL::trackEvent
The documentation for this class was generated from the following file:
- /home/opennao/work/master/perception/audio/audiobox/include/audiobox/track.hpp