kwave  18.07.70
Kwave Namespace Reference

Namespaces

 FileDrag
 

Classes

class  AboutContainer
 
class  AboutContributor
 
class  AboutDialog
 
class  AboutPlugin
 
class  AmplifyFreeDialog
 
class  AmplifyFreePlugin
 
class  App
 
class  AsciiCodecPlugin
 
class  AsciiDecoder
 
class  AsciiEncoder
 
struct  audio_dither
 
class  AudiofileCodecPlugin
 
class  AudiofileDecoder
 
class  BandPass
 
class  BandPassDialog
 
class  BandPassPlugin
 
class  BitrateSpinBox
 
class  BitrateWidget
 
class  ChannelMixer
 
class  ClipBoard
 
class  CodecBase
 
class  CodecManager
 
class  CodecPlugin
 
class  Colors
 
class  CommandHandler
 
class  Compression
 
class  CompressionWidget
 
class  ConfirmCancelProxy
 
class  Curve
 
class  CurveStreamAdapter
 
class  CurveWidget
 
class  DebugPlugin
 
class  Decoder
 
class  Delay
 
class  Drag
 
class  Encoder
 
class  FileContext
 
class  FileDialog
 
class  FileInfo
 
class  FileInfoDialog
 
class  FileInfoPlugin
 
class  FileProgress
 
class  Filter
 
class  FilterPlugin
 
class  FixedPool
 
class  FlacCodecPlugin
 
class  FlacDecoder
 
class  FlacEncoder
 
class  FrequencyResponseWidget
 
class  Functions
 
class  GenreType
 
class  GlobalLock
 
class  GotoDialog
 
class  GotoPlugin
 
class  GotoPluginBase
 
class  HMSTimeWidget
 
class  ID3_PropertyMap
 
class  ID3_QIODeviceReader
 
class  ID3_QIODeviceWriter
 
class  ImageView
 
class  Indexer
 
class  InsertAtPlugin
 
class  Interpolation
 
class  InvertableSpinBox
 
class  K3BExportDialog
 
class  K3BExportPlugin
 
class  K3BExportWidget
 
class  KeywordWidget
 
class  Label
 
struct  label_t
 
class  LabelItem
 
class  LabelList
 
class  LabelPropertiesWidget
 
class  LevelMeter
 
class  Logger
 
class  LogoWidget
 
class  LowPassDialog
 
class  LowPassFilter
 
class  LowPassPlugin
 
class  LRU_Cache
 
class  MainWidget
 
class  Matrix
 
class  MemoryDialog
 
class  MemoryManager
 
class  MemoryPlugin
 
class  MenuGroup
 
class  MenuItem
 
class  MenuList
 
class  MenuManager
 Manager class for access to Kwave's menu subsystem. More...
 
class  MenuNode
 
class  MenuRoot
 
class  MenuSub
 
class  MessageBox
 
class  MetaData
 
class  MetaDataList
 
class  MimeData
 
struct  min_wav_header_t
 
class  MixerMatrix
 
class  MouseMark
 
class  MP3CodecPlugin
 
class  MP3Decoder
 
class  MP3Encoder
 
class  MP3EncoderDialog
 
struct  MP3EncoderSettings
 
class  Mul
 
class  MultiPlaybackSink
 
class  MultiStateWidget
 
class  MultiStreamWriter
 
class  MultiTrackReader
 
class  MultiTrackSink
 
class  MultiTrackSink< SINK, true >
 
class  MultiTrackSource
 
class  MultiTrackSource< SOURCE, true >
 
class  MultiTrackWriter
 
class  MultiWriter
 
class  NewSignalDialog
 
class  NewSignalPlugin
 
class  NoiseDialog
 
class  NoiseGenerator
 
class  NoisePlugin
 
class  NormalizePlugin
 
class  Normalizer
 
class  NotchFilter
 
class  NotchFilterDialog
 
class  NotchFilterPlugin
 
class  OggCodecPlugin
 
class  OggDecoder
 
class  OggEncoder
 
class  OggSubDecoder
 
class  OggSubEncoder
 
class  OpusDecoder
 
class  OpusEncoder
 
class  Osc
 
class  OverViewCache
 
class  OverViewWidget
 
class  Parser
 
class  PitchShiftDialog
 
class  PitchShiftFilter
 
class  PitchShiftPlugin
 
class  PlayBackALSA
 
class  PlaybackController
 
class  PlayBackDevice
 
class  PlaybackDeviceFactory
 
class  PlayBackDialog
 
class  PlayBackOSS
 
class  PlayBackParam
 
class  PlayBackPlugin
 
class  PlayBackPulseAudio
 
class  PlayBackQt
 
class  PlaybackSink
 
class  PlayBackTypesMap
 
class  PlayerToolBar
 
class  Plugin
 
class  PluginManager
 
class  PluginSetupDialog
 
struct  Q_PACKED
 
class  RateConverter
 
class  RecordALSA
 
class  RecordController
 
class  RecordDevice
 
class  RecordDialog
 
class  RecordOSS
 
class  RecordParams
 
class  RecordPlugin
 
class  RecordPulseAudio
 
class  RecordQt
 
class  RecordThread
 
class  RecordTypesMap
 
class  RecoveryBuffer
 
class  RecoveryMapping
 
class  RecoverySource
 
class  RepairVirtualAudioFile
 
class  ReversePlugin
 
class  RIFFChunk
 
class  RIFFParser
 
class  Runnable
 
class  SampleArray
 
class  SampleBuffer
 
class  SampleDecoder
 
class  SampleDecoderLinear
 
class  SampleEncoder
 
class  SampleEncoderLinear
 
class  SampleFIFO
 
class  SampleFormat
 
class  SampleRatePlugin
 
class  SampleReader
 
class  SampleSink
 
class  SampleSource
 
class  SaveBlocksDialog
 
class  SaveBlocksPlugin
 
class  SaveBlocksWidget
 
class  ScaleWidget
 
class  SelectDateDialog
 
class  Selection
 
class  SelectionBorderItem
 
class  SelectionItem
 
class  SelectionTracker
 
class  SelectRangeDialog
 
class  SelectRangePlugin
 
class  SelectTimeWidget
 
class  ShortcutWrapper
 
class  Signal
 
class  SignalManager
 
class  SignalView
 
class  SignalWidget
 
class  SonagramDialog
 
class  SonagramPlugin
 
class  SonagramWindow
 
class  Splash
 
class  StandardBitrates
 
class  StatusWidget
 
class  StreamObject
 
class  StreamWriter
 
class  StringEnterDialog
 
class  StringEnterPlugin
 
class  Stripe
 
class  SwapFile
 
class  TopWidget
 
class  Track
 
class  TrackPixmap
 
class  TrackView
 
class  TrackWriter
 
class  TransmissionFunction
 
class  TreeWidgetWrapper
 
class  Triple
 
class  TypesMap
 
class  UndoAction
 
class  UndoAddMetaDataAction
 
class  UndoDeleteAction
 
class  UndoDeleteMetaDataAction
 
class  UndoDeleteTrack
 
class  UndoHandler
 
class  UndoInsertAction
 
class  UndoInsertTrack
 
class  UndoManager
 
class  UndoModifyAction
 
class  UndoModifyMetaDataAction
 
class  UndoReverseAction
 
class  UndoSelection
 
class  UndoTransaction
 
class  UndoTransactionGuard
 
class  ViewItem
 
class  ViewManager
 
class  VirtualAudioFile
 
class  VolumeDialog
 
class  VolumePlugin
 
class  VorbisCommentMap
 
class  VorbisDecoder
 
class  VorbisEncoder
 
union  wav_fmt_header_t
 
struct  wav_header_t
 
class  WavCodecPlugin
 
class  WavDecoder
 
class  WavEncoder
 
class  WavFormatMap
 
class  WavPropertyMap
 
class  WindowFunction
 
class  WorkerThread
 
class  Writer
 
class  ZeroPlugin
 
class  Zoomable
 
class  ZoomToolBar
 

Typedefs

typedef enum Kwave::byte_order_t byte_order_t
 
typedef QListIterator< Kwave::LabelLabelListIterator
 
typedef int Handle
 
typedef struct Kwave::MP3EncoderSettings MP3EncoderSettings
 
typedef QList< Kwave::RIFFChunk * > RIFFChunkList
 

Enumerations

enum  bitrate_mode_t {
  BITRATE_MODE_NONE = 0, BITRATE_MODE_ABR = 1, BITRATE_MODE_VBR = 2, BITRATE_MODE_CVBR = 3,
  BITRATE_MODE_CBR = 4, BITRATE_MODE_CBR_HARD = 5
}
 
enum  byte_order_t { UnknownEndian = -1, CpuEndian = 0, LittleEndian = 1, BigEndian = 2 }
 
enum  FileProperty {
  INF_UNKNOWN = -1, INF_ALBUM = 0, INF_ANNOTATION, INF_ARCHIVAL,
  INF_AUTHOR, INF_BITRATE_LOWER, INF_BITRATE_MODE, INF_BITRATE_NOMINAL,
  INF_BITRATE_UPPER, INF_BITS_PER_SAMPLE, INF_CD, INF_CDS,
  INF_CHANNELS, INF_COMMISSIONED, INF_COMMENTS, INF_COMPRESSION,
  INF_CONTACT, INF_COPYRIGHT, INF_COPYRIGHTED, INF_CREATION_DATE,
  INF_ENGINEER, INF_ESTIMATED_LENGTH, INF_FILENAME, INF_FILESIZE,
  INF_GENRE, INF_ISRC, INF_KEYWORDS, INF_LABELS,
  INF_LENGTH, INF_LICENSE, INF_MEDIUM, INF_MIMETYPE,
  INF_MPEG_EMPHASIS, INF_MPEG_LAYER, INF_MPEG_MODEEXT, INF_MPEG_VERSION,
  INF_NAME, INF_OPUS_FRAME_LEN, INF_ORGANIZATION, INF_ORIGINAL,
  INF_PERFORMER, INF_PRIVATE, INF_PRODUCT, INF_SAMPLE_FORMAT,
  INF_SAMPLE_RATE, INF_SOFTWARE, INF_SOURCE, INF_SOURCE_FORM,
  INF_SUBJECT, INF_TECHNICAN, INF_TRACK, INF_TRACKS,
  INF_VBR_QUALITY, INF_VERSION
}
 
enum  InsertMode { Append, Insert, Overwrite }
 
enum  interpolation_t {
  INTPOL_LINEAR = 0, INTPOL_SPLINE, INTPOL_NPOLYNOMIAL, INTPOL_POLYNOMIAL3,
  INTPOL_POLYNOMIAL5, INTPOL_POLYNOMIAL7, INTPOL_SAH
}
 
enum  playback_method_t {
  PLAYBACK_NONE = 0, PLAYBACK_JACK, PLAYBACK_QT_AUDIO, PLAYBACK_PULSEAUDIO,
  PLAYBACK_ALSA, PLAYBACK_OSS, PLAYBACK_INVALID
}
 
enum  ReaderMode { SinglePassForward, SinglePassReverse, FullSnapshot }
 
enum  window_function_t {
  WINDOW_FUNC_NONE = 0, WINDOW_FUNC_HAMMING = 1, WINDOW_FUNC_HANNING = 2, WINDOW_FUNC_BLACKMAN = 3,
  WINDOW_FUNC_TRIANGULAR = 4
}
 
enum  wav_format_id {
  WAVE_FORMAT_UNKNOWN = 0x0000, WAVE_FORMAT_PCM = 0x0001, WAVE_FORMAT_MS_ADPCM = 0x0002, WAVE_FORMAT_IEEE_FLOAT = 0x0003,
  WAVE_FORMAT_IBM_CVSD = 0x0005, WAVE_FORMAT_ALAW = 0x0006, WAVE_FORMAT_MULAW = 0x0007, WAVE_FORMAT_OKI_ADPCM = 0x0010,
  WAVE_FORMAT_IMA_ADPCM = 0x0011, WAVE_FORMAT_MEDIASPACE_ADPCM = 0x0012, WAVE_FORMAT_SIERRA_ADPCM = 0x0013, WAVE_FORMAT_G723_ADPCM = 0x0014,
  WAVE_FORMAT_DIGISTD = 0x0015, WAVE_FORMAT_DIGIFIX = 0x0016, WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 0x0017, WAVE_FORMAT_MEDIAVISION_ADPCM = 0x0018,
  WAVE_FORMAT_YAMAHA_ADPCM = 0x0020, WAVE_FORMAT_SONARC = 0x0021, WAVE_FORMAT_DSPGROUP_TRUESPEECH = 0x0022, WAVE_FORMAT_ECHOSC1 = 0x0023,
  WAVE_FORMAT_AUDIOFILE_AF18 = 0x0024, WAVE_FORMAT_APTX = 0x0025, WAVE_FORMAT_AUDIOFILE_AF10 = 0x0026, WAVE_FORMAT_DOLBY_AC2 = 0x0030,
  WAVE_FORMAT_GSM610 = 0x0031, WAVE_FORMAT_MSNAUDIO = 0x0032, WAVE_FORMAT_ANTEX_ADPCME = 0x0033, WAVE_FORMAT_CONTROL_RES_VQLPC = 0x0034,
  WAVE_FORMAT_DIGIREAL = 0x0035, WAVE_FORMAT_DIGIADPCM = 0x0036, WAVE_FORMAT_CONTROL_RES_CR10 = 0x0037, WAVE_FORMAT_NMS_VBXADPCM = 0x0038,
  WAVE_FORMAT_ROCKWELL_ADPCM = 0x003B, WAVE_FORMAT_ROCKWELL_DIGITALK = 0x003C, WAVE_FORMAT_G721_ADPCM = 0x0040, WAVE_FORMAT_MPEG = 0x0050,
  WAVE_FORMAT_MPEGLAYER3 = 0x0055, WAVE_FORMAT_IBM_MULAW = 0x0101, WAVE_FORMAT_IBM_ALAW = 0x0102, WAVE_FORMAT_IBM_ADPCM = 0x0103,
  WAVE_FORMAT_CREATIVE_ADPCM = 0x0200, WAVE_FORMAT_FM_TOWNS_SND = 0x0300, WAVE_FORMAT_OLIGSM = 0x1000, WAVE_FORMAT_OLIADPCM = 0x1001,
  WAVE_FORMAT_OLICELP = 0x1002, WAVE_FORMAT_OLISBC = 0x1003, WAVE_FORMAT_OLIOPR = 0x1004, WAVE_FORMAT_EXTENSIBLE = 0xFFFE
}
 
enum  record_method_t {
  RECORD_NONE = 0, RECORD_JACK, RECORD_QT, RECORD_PULSEAUDIO,
  RECORD_ALSA, RECORD_OSS, RECORD_INVALID
}
 
enum  RecordState {
  REC_UNINITIALIZED = 0, REC_EMPTY, REC_BUFFERING, REC_PRERECORDING,
  REC_WAITING_FOR_TRIGGER, REC_RECORDING, REC_PAUSED, REC_DONE
}
 

Functions

static bool _connect_one_by_one (Kwave::StreamObject &src, const char *output, unsigned int src_idx, Kwave::StreamObject &dst, const char *input, unsigned int dst_idx)
 
bool connect (Kwave::StreamObject &source, const char *output, Kwave::StreamObject &sink, const char *input)
 
static FileProperty operator++ (FileProperty &prop)
 
static Kwave::interpolation_toperator++ (Kwave::interpolation_t &i)
 
Kwave::playback_method_toperator++ (Kwave::playback_method_t &m)
 
void Q_DECL_EXPORT yield ()
 
QString Q_DECL_EXPORT zoom2string (double percent)
 
QString Q_DECL_EXPORT ms2string (double ms, int precision=6)
 
QString Q_DECL_EXPORT samples2string (sample_index_t samples)
 
QString Q_DECL_EXPORT ms2hms (double ms)
 
QString Q_DECL_EXPORT string2date (const QString &s)
 
template<class T >
round_up (T x, const T s)
 
template<typename T >
unsigned int toUint (T x)
 
template<typename T >
int toInt (T x)
 
QString Q_DECL_EXPORT urlScheme ()
 
static window_function_toperator++ (window_function_t &f)
 
int opus_next_sample_rate (int rate)
 
QString opus_error (int err)
 
QList< Kwave::Compression::TypeaudiofileCompressionTypes ()
 
Kwave::record_method_toperator++ (Kwave::record_method_t &m)
 

Detailed Description

struct for info about a label within a Kwave script

Wrapper for keyboard shortcuts, emits signal activated(id)

The TrackPixmap is a graphical representation of a track's sample data. It is connected directly to a Track object so that it is able to get any needed sample data on it's own. It provides internal caching mechanisms for reducing (slow) accesses to the track; this is especially needed for speeding up the handling large wav files.

Note
The sample ranges in this class are a kind of "virtual", it is possible that the length of this pixmap in samples is larger than the track. However, this should not do any harm and might even be useful if a track grows.
Todo:

If the "interpolated mode" is used, the sample buffer should contain some samples before and some samples after the current view. (m_extra_samples, calculated in set_zoom, !=0 only in interpolation mode, ignored in all other modes.

optimizations if zoom factor is multiple of last zoom factor

optimizations in slotSamplesDeleted and slotSamplesInserted if parts of the current buffers can be re-used

Todo:
Check setOffset()
Author
Thomas Eschenbacher Thoma.nosp@m.s.Es.nosp@m.chenb.nosp@m.ache.nosp@m.r@gmx.nosp@m..de

(copied from mpg231, mad.c)

Author
Rob Leslie

Typedef Documentation

◆ byte_order_t

◆ Handle

typedef int Kwave::Handle

handle for memory manager

Definition at line 34 of file MemoryManager.h.

◆ LabelListIterator

typedef QListIterator<Kwave::Label> Kwave::LabelListIterator

Iterator for the list of labels

Definition at line 76 of file LabelList.h.

◆ MP3EncoderSettings

◆ RIFFChunkList

shortcut for list of RIFF chunks

Definition at line 30 of file RIFFChunk.h.

Enumeration Type Documentation

◆ bitrate_mode_t

Enumerator
BITRATE_MODE_NONE 

no preference

BITRATE_MODE_ABR 

average bitrate

BITRATE_MODE_VBR 

variable bitrage

BITRATE_MODE_CVBR 

constant variable bitrage

BITRATE_MODE_CBR 

constant bitrate

BITRATE_MODE_CBR_HARD 

hard constant bitrate

Definition at line 25 of file BitrateMode.h.

◆ byte_order_t

Enumerator
UnknownEndian 

unknown/invalid

CpuEndian 

default of the host system's CPU

LittleEndian 

little endian (Intel)

BigEndian 

big endian (Motorola)

Definition at line 25 of file ByteOrder.h.

25  {
26  UnknownEndian = -1,
27  CpuEndian = 0,
28  LittleEndian = 1,
29  BigEndian = 2
30  } byte_order_t;
enum Kwave::byte_order_t byte_order_t

◆ FileProperty

Enumeration type that lists all file properties. If you extend this list, please don't forget to add a verbose name and a description of it in FileInfo.cpp

Enumerator
INF_UNKNOWN 

dummy for unknown/unsupported property

INF_ALBUM 

name of the album

INF_ANNOTATION 

annotation/comment

INF_ARCHIVAL 

archival location

INF_AUTHOR 

name of the author/artist

INF_BITRATE_LOWER 

lower bitrate limit

INF_BITRATE_MODE 

bitrate mode (ABR, VBR, CBR, etc...)

INF_BITRATE_NOMINAL 

nominal bitrate

INF_BITRATE_UPPER 

upper bitrate limit

INF_BITS_PER_SAMPLE 

number of bits per sample

INF_CD 

number of the CD in an album

INF_CDS 

number of CDs in an album

INF_CHANNELS 

number of tracks of the signal

INF_COMMISSIONED 

commissioned

INF_COMMENTS 

comments

INF_COMPRESSION 

compression mode (libaudiofile)

INF_CONTACT 

contact information for creator

INF_COPYRIGHT 

copyright text

INF_COPYRIGHTED 

"copyright" flag

INF_CREATION_DATE 

creation date

INF_ENGINEER 

engineer

INF_ESTIMATED_LENGTH 

estimated length in samples

INF_FILENAME 

name of the file

INF_FILESIZE 

size of the file in bytes

INF_GENRE 

genre

INF_ISRC 

International Standard Recording Code

INF_KEYWORDS 

keywords

INF_LABELS 

labels/markers

INF_LENGTH 

length of the file in samples

INF_LICENSE 

license information

INF_MEDIUM 

medium

INF_MIMETYPE 

mime type of the file format

INF_MPEG_EMPHASIS 

MPEG emphasis mode

INF_MPEG_LAYER 

MPEG Layer, I/II/III

INF_MPEG_MODEEXT 

MPEG mode extension

INF_MPEG_VERSION 

MPEG version

INF_NAME 

name of the song or whatever

INF_OPUS_FRAME_LEN 

Opus codec: frame length in ms

INF_ORGANIZATION 

organization/label

INF_ORIGINAL 

true=original, false=copy

INF_PERFORMER 

name ot the performer

INF_PRIVATE 

"private" bit

INF_PRODUCT 

product

INF_SAMPLE_FORMAT 

sample format (libaudiofile)

INF_SAMPLE_RATE 

sample rate (bits/sample)

INF_SOFTWARE 

software

INF_SOURCE 

source

INF_SOURCE_FORM 

source form

INF_SUBJECT 

subject

INF_TECHNICAN 

technican

INF_TRACK 

track of the CD

INF_TRACKS 

number of tracks of the CD

INF_VBR_QUALITY 

base quality of an ogg file in VBR mode

INF_VERSION 

version/remix

Definition at line 45 of file FileInfo.h.

45  {
46  INF_UNKNOWN = -1,
47  // please sort in new items alphabetically...
48  INF_ALBUM = 0,
50  INF_ARCHIVAL,
51  INF_AUTHOR,
57  INF_CD,
58  INF_CDS,
59  INF_CHANNELS,
61  INF_COMMENTS,
63  INF_CONTACT,
67  INF_ENGINEER,
69  INF_FILENAME,
70  INF_FILESIZE,
71  INF_GENRE,
72  INF_ISRC,
73  INF_KEYWORDS,
74  INF_LABELS,
75  INF_LENGTH,
76  INF_LICENSE,
77  INF_MEDIUM,
78  INF_MIMETYPE,
83  INF_NAME,
86  INF_ORIGINAL,
88  INF_PRIVATE,
89  INF_PRODUCT,
92  INF_SOFTWARE,
93  INF_SOURCE,
95  INF_SUBJECT,
97  INF_TRACK,
98  INF_TRACKS,
100  INF_VERSION
101  } FileProperty;
FileProperty
Definition: FileInfo.h:45

◆ InsertMode

Modes for inserting data into a track.

Enumerator
Append 

Append a new stripe to the end of the track. If the last stripe is zero-length, it will be used instead of a new one in order to avoid a trailing zero-length stripe.

Insert 

Insert data into a new stripe. If the position is within an existing stripe, that stripe will be split into two ones and the new stripe is inserted between them. If the position is after the end of the track, an empty stripe will be appended first to pad up to the wanted position.

Overwrite 

Overwrite data within a given range. The range can span over several stripes. If the position is after the last sample, an empty stripe will be appended first to pad up to the wanted position. If the end of the track is reached, a new stripe will be appended.

Definition at line 26 of file InsertMode.h.

◆ interpolation_t

Enumerator
INTPOL_LINEAR 
INTPOL_SPLINE 
INTPOL_NPOLYNOMIAL 
INTPOL_POLYNOMIAL3 
INTPOL_POLYNOMIAL5 
INTPOL_POLYNOMIAL7 
INTPOL_SAH 

Definition at line 34 of file Interpolation.h.

◆ playback_method_t

enum for the known playback methods (sorted, preferred first)

Enumerator
PLAYBACK_NONE 

none selected

PLAYBACK_JACK 

Jack sound daemon

PLAYBACK_QT_AUDIO 

Qt Multimedia

PLAYBACK_PULSEAUDIO 

PulseAudio Sound Server

PLAYBACK_ALSA 

ALSA native

PLAYBACK_OSS 

OSS native or ALSA OSS emulation

PLAYBACK_INVALID 

(keep this the last entry, EOL delimiter)

Definition at line 31 of file PlayBackParam.h.

◆ ReaderMode

operation modes for Kwave's SampleReader

Enumerator
SinglePassForward 

seekable in forward direction only, can be used only once. Passed stripes will be removed from the internal list and cannot be reached again.

Note
prefer this one wherever possible!
SinglePassReverse 

seekable in backward direction only, like SinglePassForward but delivers samples in reverse order.

Note
useful for "reverse" effect or similar
FullSnapshot 

seekable with random access, can be used several times. Passed stripes will never be discarded.

Note
use with care: can be very memory expensive as it can produce a implicit copy of the whole track!

Definition at line 27 of file ReaderMode.h.

◆ record_method_t

enum for the known recording methods (sorted, preferred first)

Enumerator
RECORD_NONE 

none selected

RECORD_JACK 

Jack sound daemon

RECORD_QT 

Qt Multimedia Audio

RECORD_PULSEAUDIO 

PulseAudio sound daemon

RECORD_ALSA 

ALSA native

RECORD_OSS 

OSS native or ALSA OSS emulation

RECORD_INVALID 

(keep this the last entry, EOL delimiter)

Definition at line 37 of file RecordParams.h.

◆ RecordState

Enumerator
REC_UNINITIALIZED 

Settings are not valid yet, cannot open device etc...

REC_EMPTY 

Empty, nothing recorded yet and no recording started

REC_BUFFERING 

Buffering data for pre-recording, if pre-recording is enabled. Otherwise the state will advance to REC_WAITING_FOR_TRIGGER immediately.

REC_PRERECORDING 

Pre-recording data into a FIFO. If a trigger has been set, this is equal to REC_WAITING_FOR_TRIGGER and the trigger will start the recording.

REC_WAITING_FOR_TRIGGER 

Waiting for reaching the trigger if a trigger has been set and enabled. Otherwise the state will advance to REC_RECORDING immediately.

REC_RECORDING 

Recording is in progress, producing real data. Can change to REC_PAUSED or REC_DONE.

REC_PAUSED 

Recording is paused, normally for waiting until the user presses "continue". After pause either the previous state will be set again or the recording can be stopped (change to REC_DONE) or canceled (change to REC_EMPTY).

REC_DONE 

Recording done, data was produced.

Definition at line 25 of file RecordState.h.

◆ wav_format_id

Enumerator
WAVE_FORMAT_UNKNOWN 
WAVE_FORMAT_PCM 
WAVE_FORMAT_MS_ADPCM 
WAVE_FORMAT_IEEE_FLOAT 
WAVE_FORMAT_IBM_CVSD 
WAVE_FORMAT_ALAW 
WAVE_FORMAT_MULAW 
WAVE_FORMAT_OKI_ADPCM 
WAVE_FORMAT_IMA_ADPCM 
WAVE_FORMAT_MEDIASPACE_ADPCM 
WAVE_FORMAT_SIERRA_ADPCM 
WAVE_FORMAT_G723_ADPCM 
WAVE_FORMAT_DIGISTD 
WAVE_FORMAT_DIGIFIX 
WAVE_FORMAT_DIALOGIC_OKI_ADPCM 
WAVE_FORMAT_MEDIAVISION_ADPCM 
WAVE_FORMAT_YAMAHA_ADPCM 
WAVE_FORMAT_SONARC 
WAVE_FORMAT_DSPGROUP_TRUESPEECH 
WAVE_FORMAT_ECHOSC1 
WAVE_FORMAT_AUDIOFILE_AF18 
WAVE_FORMAT_APTX 
WAVE_FORMAT_AUDIOFILE_AF10 
WAVE_FORMAT_DOLBY_AC2 
WAVE_FORMAT_GSM610 
WAVE_FORMAT_MSNAUDIO 
WAVE_FORMAT_ANTEX_ADPCME 
WAVE_FORMAT_CONTROL_RES_VQLPC 
WAVE_FORMAT_DIGIREAL 
WAVE_FORMAT_DIGIADPCM 
WAVE_FORMAT_CONTROL_RES_CR10 
WAVE_FORMAT_NMS_VBXADPCM 
WAVE_FORMAT_ROCKWELL_ADPCM 
WAVE_FORMAT_ROCKWELL_DIGITALK 
WAVE_FORMAT_G721_ADPCM 
WAVE_FORMAT_MPEG 
WAVE_FORMAT_MPEGLAYER3 
WAVE_FORMAT_IBM_MULAW 
WAVE_FORMAT_IBM_ALAW 
WAVE_FORMAT_IBM_ADPCM 
WAVE_FORMAT_CREATIVE_ADPCM 
WAVE_FORMAT_FM_TOWNS_SND 
WAVE_FORMAT_OLIGSM 
WAVE_FORMAT_OLIADPCM 
WAVE_FORMAT_OLICELP 
WAVE_FORMAT_OLISBC 
WAVE_FORMAT_OLIOPR 
WAVE_FORMAT_EXTENSIBLE 

Definition at line 28 of file WavFileFormat.h.

29  {
30  WAVE_FORMAT_UNKNOWN = 0x0000, /* Microsoft Corporation */
31  WAVE_FORMAT_PCM = 0x0001, /* Microsoft PCM format */
32 
33  WAVE_FORMAT_MS_ADPCM = 0x0002, /* Microsoft ADPCM */
34  WAVE_FORMAT_IEEE_FLOAT = 0x0003, /* Micrososft 32 bit float format */
35 
36  WAVE_FORMAT_IBM_CVSD = 0x0005, /* IBM Corporation */
37  WAVE_FORMAT_ALAW = 0x0006, /* Microsoft Corporation */
38  WAVE_FORMAT_MULAW = 0x0007, /* Microsoft Corporation */
39  WAVE_FORMAT_OKI_ADPCM = 0x0010, /* OKI */
40  WAVE_FORMAT_IMA_ADPCM = 0x0011, /* Intel Corporation */
41  WAVE_FORMAT_MEDIASPACE_ADPCM = 0x0012, /* Videologic */
42  WAVE_FORMAT_SIERRA_ADPCM = 0x0013, /* Sierra Semiconductor Corp */
43  WAVE_FORMAT_G723_ADPCM = 0x0014, /* Antex Electronics Corporation */
44  WAVE_FORMAT_DIGISTD = 0x0015, /* DSP Solutions, Inc. */
45  WAVE_FORMAT_DIGIFIX = 0x0016, /* DSP Solutions, Inc. */
46  WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 0x0017, /* Dialogic Corporation */
47  WAVE_FORMAT_MEDIAVISION_ADPCM = 0x0018, /* Media Vision, Inc. */
48 
49  WAVE_FORMAT_YAMAHA_ADPCM = 0x0020, /* Yamaha Corporation of America */
50  WAVE_FORMAT_SONARC = 0x0021, /* Speech Compression */
51  WAVE_FORMAT_DSPGROUP_TRUESPEECH = 0x0022, /* DSP Group, Inc */
52  WAVE_FORMAT_ECHOSC1 = 0x0023, /* Echo Speech Corporation */
53  WAVE_FORMAT_AUDIOFILE_AF18 = 0x0024, /* Audiofile, Inc. */
54  WAVE_FORMAT_APTX = 0x0025, /* Audio Processing Technology */
55  WAVE_FORMAT_AUDIOFILE_AF10 = 0x0026, /* Audiofile, Inc. */
56 
57  WAVE_FORMAT_DOLBY_AC2 = 0x0030, /* Dolby Laboratories */
58  WAVE_FORMAT_GSM610 = 0x0031, /* Microsoft Corporation */
59  WAVE_FORMAT_MSNAUDIO = 0x0032, /* Microsoft Corporation */
60  WAVE_FORMAT_ANTEX_ADPCME = 0x0033, /* Antex Electronics Corporation */
61  WAVE_FORMAT_CONTROL_RES_VQLPC = 0x0034, /* Control Resources Limited */
62  WAVE_FORMAT_DIGIREAL = 0x0035, /* DSP Solutions, Inc. */
63  WAVE_FORMAT_DIGIADPCM = 0x0036, /* DSP Solutions, Inc. */
64  WAVE_FORMAT_CONTROL_RES_CR10 = 0x0037, /* Control Resources Limited */
65  WAVE_FORMAT_NMS_VBXADPCM = 0x0038, /* Natural MicroSystems */
66  WAVE_FORMAT_ROCKWELL_ADPCM = 0x003B, /* Rockwell International */
67  WAVE_FORMAT_ROCKWELL_DIGITALK = 0x003C, /* Rockwell International */
68 
69  WAVE_FORMAT_G721_ADPCM = 0x0040, /* Antex Electronics Corporation */
70  WAVE_FORMAT_MPEG = 0x0050, /* Microsoft Corporation */
71 
72  WAVE_FORMAT_MPEGLAYER3 = 0x0055, /* MPEG 3 Layer 1 */
73 
74  WAVE_FORMAT_IBM_MULAW = 0x0101, /* IBM mu-law format */
75  WAVE_FORMAT_IBM_ALAW = 0x0102, /* IBM a-law format */
76  WAVE_FORMAT_IBM_ADPCM = 0x0103, /* IBM AVC Adaptive Differential PCM format */
77 
78  WAVE_FORMAT_CREATIVE_ADPCM = 0x0200, /* Creative Labs, Inc */
79 
80  WAVE_FORMAT_FM_TOWNS_SND = 0x0300, /* Fujitsu Corp. */
81  WAVE_FORMAT_OLIGSM = 0x1000, /* Ing C. Olivetti & C., S.p.A. */
82  WAVE_FORMAT_OLIADPCM = 0x1001, /* Ing C. Olivetti & C., S.p.A. */
83  WAVE_FORMAT_OLICELP = 0x1002, /* Ing C. Olivetti & C., S.p.A. */
84  WAVE_FORMAT_OLISBC = 0x1003, /* Ing C. Olivetti & C., S.p.A. */
85  WAVE_FORMAT_OLIOPR = 0x1004, /* Ing C. Olivetti & C., S.p.A. */
86 
87  WAVE_FORMAT_EXTENSIBLE = 0xFFFE
88  } wav_format_id;
#define WAVE_FORMAT_PCM
Definition: MimeData.cpp:50

◆ window_function_t

enumeration of window functions

Enumerator
WINDOW_FUNC_NONE 
WINDOW_FUNC_HAMMING 
WINDOW_FUNC_HANNING 
WINDOW_FUNC_BLACKMAN 
WINDOW_FUNC_TRIANGULAR 

Definition at line 34 of file WindowFunction.h.

Function Documentation

◆ _connect_one_by_one()

static bool Kwave::_connect_one_by_one ( Kwave::StreamObject src,
const char *  output,
unsigned int  src_idx,
Kwave::StreamObject dst,
const char *  input,
unsigned int  dst_idx 
)
static

Definition at line 30 of file Connect.cpp.

References connect(), and Kwave::StreamObject::port().

Referenced by connect().

33  {
34  Kwave::StreamObject *s = src.port(output, src_idx);
35  Kwave::StreamObject *d = dst.port(input, dst_idx);
36  Q_ASSERT(s);
37  Q_ASSERT(d);
38  Q_ASSERT(input);
39  Q_ASSERT(output);
40  if (!s || !d || !input || !output) return false;
41 
42  QObject::connect(s, output, d, input, Qt::DirectConnection);
43 
44  return true;
45  }
bool connect(Kwave::StreamObject &source, const char *output, Kwave::StreamObject &sink, const char *input)
Definition: Connect.cpp:48
virtual Kwave::StreamObject * port(const char *port, unsigned int track)
Definition: StreamObject.h:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audiofileCompressionTypes()

QList< Kwave::Compression::Type > Kwave::audiofileCompressionTypes ( )

Returns a list with all compression types supported by libaudiofile

Definition at line 26 of file WavFileFormat.cpp.

References Kwave::Compression::fromAudiofile().

27 {
28  QList<Kwave::Compression::Type> list;
29 
30  const long int numCompressionTypes = afQueryLong(
31  AF_QUERYTYPE_COMPRESSION, AF_QUERY_ID_COUNT, 0, 0, 0);
32 
33  if (numCompressionTypes != 0) {
34  int *compressions = static_cast<int *>(afQueryPointer(
35  AF_QUERYTYPE_COMPRESSION, AF_QUERY_IDS, 0, 0, 0));
36 
37  if (compressions) {
38  for (long int index = 0; index < numCompressionTypes; index++) {
39  Kwave::Compression::Type compression_type =
40  Kwave::Compression::fromAudiofile(compressions[index]);
41  if (!list.contains(compression_type))
42  list.append(compression_type);
43  }
44  free(compressions);
45  }
46  }
47 
48  return list;
49 }
static Kwave::Compression::Type fromAudiofile(int af_compression)
Here is the call graph for this function:

◆ connect()

bool Kwave::connect ( Kwave::StreamObject source,
const char *  output,
Kwave::StreamObject sink,
const char *  input 
)

Connect an output of a Kwave::SampleSource to the input of a Kwave::SampleSink. The following combinations of single-track and multi-track sources/sinks are allowed.:

  • single -> single (1:1)
  • single -> multi (1:N)
  • multi -> multi (N:N)
Parameters
sourcea Kwave::SampleSource that produces data
outputname of the output, must be formed with the Qt macro SIGNAL(...) out of a Qt style signal.
sinka Kwave::SampleSink that can receive data
inputname of the inputm must be formed with the Qt macro SLOT(...) out of a Qt style (public) slot .
Returns
true if successful or false if either
  • an invalid combination of single/multi track source/sink has been passed
  • a source or sink's track is NULL (missing)
  • input or output name is zero-length

Definition at line 48 of file Connect.cpp.

References _connect_one_by_one(), and Kwave::StreamObject::tracksOfPort().

Referenced by _connect_one_by_one(), Kwave::AmplifyFreeDialog::AmplifyFreeDialog(), Kwave::App::App(), Kwave::BandPassDialog::BandPassDialog(), Kwave::BitrateSpinBox::BitrateSpinBox(), Kwave::BitrateWidget::BitrateWidget(), Kwave::CompressionWidget::CompressionWidget(), Kwave::ConfirmCancelProxy::ConfirmCancelProxy(), Kwave::HMSTimeWidget::connect(), Kwave::SelectTimeWidget::connect(), Kwave::TopWidget::connectContext(), Kwave::PluginManager::connectPlugin(), Kwave::SignalWidget::contextMenuEvent(), Kwave::PlayerToolBar::contextSwitched(), Kwave::NoisePlugin::createDialog(), Kwave::BandPassPlugin::createDialog(), Kwave::NotchFilterPlugin::createDialog(), Kwave::PitchShiftPlugin::createDialog(), Kwave::LowPassPlugin::createDialog(), Kwave::RecordQt::createInMainThread(), Kwave::FileContext::createMainWidget(), Kwave::CurveWidget::CurveWidget(), Kwave::MimeData::decode(), Kwave::OpusDecoder::decode(), Kwave::FileContext::FileContext(), Kwave::FileDialog::FileDialog(), Kwave::FileInfoDialog::FileInfoDialog(), Kwave::FileProgress::FileProgress(), Kwave::GotoDialog::GotoDialog(), Kwave::ChannelMixer::init(), Kwave::SelectTimeWidget::init(), Kwave::FileContext::init(), Kwave::TopWidget::init(), Kwave::MultiTrackWriter::init(), Kwave::MultiWriter::insert(), Kwave::MultiTrackReader::insert(), Kwave::TopWidget::insertContext(), Kwave::Signal::insertTrack(), Kwave::SignalWidget::insertView(), Kwave::InvertableSpinBox::InvertableSpinBox(), Kwave::KeywordWidget::KeywordWidget(), Kwave::LevelMeter::LevelMeter(), Kwave::SignalManager::loadFile(), Kwave::LogoWidget::LogoWidget(), Kwave::LowPassDialog::LowPassDialog(), main(), Kwave::MainWidget::MainWidget(), Kwave::MemoryDialog::MemoryDialog(), Kwave::MenuItem::MenuItem(), Kwave::MenuManager::MenuManager(), Kwave::MP3Encoder::MP3Encoder(), Kwave::MP3EncoderDialog::MP3EncoderDialog(), Kwave::MultiPlaybackSink::MultiPlaybackSink(), Kwave::App::newInstance(), Kwave::NewSignalDialog::NewSignalDialog(), Kwave::App::newWindow(), Kwave::NoiseDialog::NoiseDialog(), Kwave::NotchFilterDialog::NotchFilterDialog(), Kwave::WavDecoder::open(), Kwave::PlayBackQt::open(), Kwave::OpusEncoder::open(), Kwave::OpusDecoder::open(), Kwave::Track::openWriter(), Kwave::OverViewCache::OverViewCache(), Kwave::OverViewWidget::OverViewWidget(), Kwave::PitchShiftDialog::PitchShiftDialog(), Kwave::PlaybackController::PlaybackController(), Kwave::PlayBackDialog::PlayBackDialog(), Kwave::PlayerToolBar::playbackPaused(), Kwave::Plugin::Plugin(), Kwave::RecordDialog::RecordDialog(), Kwave::RecordPlugin::RecordPlugin(), Kwave::RecordQt::RecordQt(), Kwave::SampleRatePlugin::run(), Kwave::ReversePlugin::run(), Kwave::ZeroPlugin::run(), Kwave::VolumePlugin::run(), Kwave::AmplifyFreePlugin::run(), Kwave::NormalizePlugin::run(), Kwave::DebugPlugin::run(), Kwave::PlayBackPlugin::run(), Kwave::FilterPlugin::run(), Kwave::SignalManager::save(), Kwave::SaveBlocksDialog::SaveBlocksDialog(), Kwave::SaveBlocksWidget::SaveBlocksWidget(), Kwave::SelectionTracker::SelectionTracker(), Kwave::SelectRangeDialog::SelectRangeDialog(), Kwave::StreamObject::setAttribute(), Kwave::FileContext::setParent(), Kwave::SaveBlocksPlugin::setup(), Kwave::RecordPlugin::setup(), Kwave::PlayBackPlugin::setup(), Kwave::FilterPlugin::setup(), Kwave::OpusEncoder::setupCodingRate(), Kwave::FileInfoDialog::setupContentTab(), Kwave::OpusEncoder::setupDownMix(), Kwave::FileInfoDialog::setupFileInfoTab(), Kwave::FileInfoDialog::setupMiscellaneousTab(), Kwave::ShortcutWrapper::ShortcutWrapper(), Kwave::SignalManager::SignalManager(), Kwave::SignalView::SignalView(), Kwave::SignalWidget::SignalWidget(), Kwave::SonagramDialog::SonagramDialog(), Kwave::SonagramPlugin::SonagramPlugin(), Kwave::SonagramWindow::SonagramWindow(), Kwave::SonagramPlugin::start(), Kwave::Plugin::start(), Kwave::StatusWidget::StatusWidget(), Kwave::App::switchGuiType(), Kwave::PlayBackPlugin::testPlayBack(), Kwave::SelectTimeWidget::time(), Kwave::TrackPixmap::TrackPixmap(), Kwave::TrackView::TrackView(), Kwave::VolumeDialog::VolumeDialog(), and Kwave::ZoomToolBar::ZoomToolBar().

50  {
51  unsigned int src_tracks = source.tracksOfPort(output);
52  unsigned int dst_tracks = sink.tracksOfPort(input);
53 
54  Q_ASSERT(output);
55  Q_ASSERT(input);
56  if (!src_tracks || !dst_tracks || !output || !input)
57  return false;
58 
59  if ((src_tracks == 1) && (dst_tracks > 1)) {
60  // 1 output -> N inputs
61  for (unsigned int track = 0; track < dst_tracks; track++) {
63  source, output, 0,
64  sink, input, track)) return false;
65  }
66  } else if (src_tracks == dst_tracks) {
67  // N outputs -> N inputs
68  for (unsigned int track=0; track < dst_tracks; track++) {
70  source, output, track,
71  sink, input, track)) return false;
72  }
73  } else {
74  qWarning("invalid source/sink combination, %d:%d tracks",
75  src_tracks, dst_tracks);
76  return false;
77  }
78  return true;
79  }
virtual unsigned int tracksOfPort(const char *port) const
Definition: StreamObject.h:72
static bool _connect_one_by_one(Kwave::StreamObject &src, const char *output, unsigned int src_idx, Kwave::StreamObject &dst, const char *input, unsigned int dst_idx)
Definition: Connect.cpp:30
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ms2hms()

QString Kwave::ms2hms ( double  ms)

Converts a time in milliseconds into a string with hours, minutes, seconds and milliseconds.

Parameters
mstime in milliseconds
Returns
time formatted as HH:MM:SS:mmmm

Definition at line 104 of file Utils.cpp.

References UTF8.

Referenced by Kwave::SelectionBorderItem::toolTip(), and Kwave::LabelItem::toolTip().

105 {
106  unsigned int t, h, m, s, tms;
107  t = static_cast<unsigned int>(rint(ms * 10.0));
108  tms = t % 10000;
109  t /= 10000;
110  s = t % 60;
111  t /= 60;
112  m = t % 60;
113  t /= 60;
114  h = t;
115 
116  QString hms_format = i18nc(
117  "time of label tooltip, %1=hour, %2=minute, %3=second, %4=milliseconds",
118  "%02u:%02u:%02u.%04u");
119  QString hms;
120  hms.sprintf(UTF8(hms_format), h, m, s, tms);
121 
122  return hms;
123 }
#define UTF8(qs)
Definition: String.h:48
Here is the caller graph for this function:

◆ ms2string()

QString Kwave::ms2string ( double  ms,
int  precision = 6 
)

Converts a time in milliseconds into a string. Times below one millisecond are formated with an automatically adjusted number of decimals. Times below one second are formated like "9.9 ms". Times above one second and below one minute are rounded up to full seconds and shown as "12.3 s". From one full minute upwards time is shown as "12:34" (like most CD players do).

Parameters
mstime in milliseconds
precisionnumber of digits after the comma, for limiting the length. optional, default = 6 digits, must be >= 3 !
Returns
time formatted as user-readable string

Definition at line 66 of file Utils.cpp.

References _, and toInt().

Referenced by Kwave::SonagramWindow::cursorPosChanged(), Kwave::TopWidget::metaDataChanged(), Kwave::TopWidget::selectionChanged(), Kwave::FileProgress::setLength(), Kwave::SonagramDialog::setPoints(), Kwave::FileInfoDialog::setupFileInfoTab(), Kwave::RecordDialog::updateBufferState(), and Kwave::FileContext::updatePlaybackPos().

67 {
68  QString result;
69 
70  if (ms < 1.0) {
71  // limit precision, use 0.0 for exact zero
72  int digits = (ms != 0.0) ? Kwave::toInt(ceil(1.0 - log10(ms))) : 1;
73  if ( (digits < 0) || (digits > precision)) digits = precision;
74 
75  result = _("%1 ms").arg(ms, 0, 'f', digits);
76  } else if (ms < 1000.0) {
77  result = _("%1 ms").arg(ms, 0, 'f', 1);
78  } else {
79  int s = Kwave::toInt(round(ms / 1000.0));
80  int m = Kwave::toInt(floor(s / 60.0));
81 
82  if (m < 1) {
83  int digits = Kwave::toInt(
84  ceil(static_cast<double>(precision + 1) - log10(ms)));
85  result = _("%1 s").arg(
86  static_cast<double>(ms) / 1000.0, 0, 'f', digits);
87  } else {
88  result = _("%1:%2 min").arg(
89  m, 2, 10, QLatin1Char('0')).arg(
90  s % 60, 2, 10, QLatin1Char('0'));
91  }
92  }
93 
94  return result;
95 }
int toInt(T x)
Definition: Utils.h:127
#define _(m)
Definition: memcpy.c:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator++() [1/5]

Kwave::playback_method_t& Kwave::operator++ ( Kwave::playback_method_t m)
inline

post-increment operator for the playback method

Definition at line 42 of file PlayBackParam.h.

References PLAYBACK_INVALID.

42  {
43  return (m = (m < Kwave::PLAYBACK_INVALID) ?
44  static_cast<Kwave::playback_method_t>(static_cast<int>(m) + 1) : m);
45  }

◆ operator++() [2/5]

Kwave::record_method_t& Kwave::operator++ ( Kwave::record_method_t m)
inline

post-increment operator for the record method

Definition at line 48 of file RecordParams.h.

References RECORD_INVALID.

48  {
49  return (m = (m < Kwave::RECORD_INVALID) ?
50  static_cast<Kwave::record_method_t>(
51  static_cast<int>(m) + 1) : m);
52  }

◆ operator++() [3/5]

static FileProperty Kwave::operator++ ( FileProperty prop)
inlinestatic

increment operator for FileProperty

Definition at line 104 of file FileInfo.h.

104  {
105  prop = static_cast<FileProperty>(static_cast<unsigned int>(prop) + 1);
106  return prop;
107  }
FileProperty
Definition: FileInfo.h:45

◆ operator++() [4/5]

static window_function_t& Kwave::operator++ ( window_function_t f)
inlinestatic

Definition at line 147 of file WindowFunction.h.

References WINDOW_FUNC_NONE, and WINDOW_FUNC_TRIANGULAR.

◆ operator++() [5/5]

static Kwave::interpolation_t& Kwave::operator++ ( Kwave::interpolation_t i)
inlinestatic

Definition at line 201 of file Interpolation.h.

References INTPOL_LINEAR, and INTPOL_SAH.

202  {
203  return (i = (i == INTPOL_SAH) ?
204  INTPOL_LINEAR :
205  Kwave::interpolation_t(i + 1) );
206  }
interpolation_t
Definition: Interpolation.h:34

◆ opus_error()

QString Kwave::opus_error ( int  err)

Transforms an error code from the Opus library into a QString

Parameters
errone of the OPUS_... error codes
Returns
a QString with the error code (localized)

Definition at line 45 of file OpusCommon.cpp.

Referenced by Kwave::OpusDecoder::decode(), Kwave::OpusEncoder::encode(), Kwave::OpusEncoder::open(), Kwave::OpusDecoder::open(), Kwave::OpusEncoder::setupBitrateMode(), and Kwave::OpusEncoder::setupEncoder().

46 {
47  QString msg;
48 
49  switch (err)
50  {
51  case OPUS_OK:
52  msg = QString();
53  break;
54  case OPUS_BAD_ARG:
55  msg = i18n("One or more invalid/out of range arguments.");
56  break;
57  case OPUS_BUFFER_TOO_SMALL:
58  msg = i18n("The mode struct passed is invalid.");
59  break;
60  case OPUS_INTERNAL_ERROR:
61  msg = i18n("An internal error was detected.");
62  break;
63  case OPUS_INVALID_PACKET:
64  msg = i18n("The compressed data passed is corrupted.");
65  break;
66  case OPUS_UNIMPLEMENTED:
67  msg = i18n("Invalid/unsupported request number.");
68  break;
69  case OPUS_INVALID_STATE:
70  msg = i18n("A decoder structure is invalid or already freed.");
71  break;
72  case OPUS_ALLOC_FAIL:
73  msg = i18n("Out of memory");
74  break;
75  default:
76  msg = i18n("Decoder error: %1",
77  QString::fromLocal8Bit(opus_strerror(err)));
78  break;
79  }
80  return msg;
81 }
Here is the caller graph for this function:

◆ opus_next_sample_rate()

int Kwave::opus_next_sample_rate ( int  rate)

round up to the next supported sample rate

Parameters
ratearbitrary sample rate
Returns
next supported rate

Definition at line 30 of file OpusCommon.cpp.

Referenced by Kwave::OpusDecoder::close(), Kwave::OpusDecoder::open(), and Kwave::OpusEncoder::setupCodingRate().

31 {
32  if (rate < 8000)
33  return 8000;
34  else if (rate <= 12000)
35  return 12000;
36  else if (rate <= 16000)
37  return 16000;
38  else if (rate <= 24000)
39  return 24000;
40  else
41  return 48000;
42 }
Here is the caller graph for this function:

◆ round_up()

template<class T >
T Kwave::round_up ( x,
const T  s 
)

Round up a numeric value

Parameters
xvalue to round up
sunit size
Returns
x rounded up to the next unit

Definition at line 96 of file Utils.h.

Referenced by Kwave::OverViewCache::slotInvalidated(), and Kwave::SonagramPlugin::slotInvalidated().

97  {
98  T modulo = (x % s);
99  if (modulo) x += (s - modulo);
100  return x;
101  }
Here is the caller graph for this function:

◆ samples2string()

QString Kwave::samples2string ( sample_index_t  samples)

Converts a number of samples (aka sample_index_t) into a string, according the current locale settings.

Parameters
samplesnumber of sample
Returns
number formatted with thousands separators

Definition at line 98 of file Utils.cpp.

References toUint().

Referenced by Kwave::TopWidget::metaDataChanged(), Kwave::TopWidget::selectionChanged(), Kwave::FileInfoDialog::setupFileInfoTab(), Kwave::RecordDialog::updateBufferState(), and Kwave::FileContext::updatePlaybackPos().

99 {
100  return QLocale().toString(Kwave::toUint(samples));
101 }
unsigned int toUint(T x)
Definition: Utils.h:109
Here is the call graph for this function:
Here is the caller graph for this function:

◆ string2date()

QString Kwave::string2date ( const QString &  s)

Tries to convert a string into a QDate

Parameters
sstring to convert
Returns
a ISO 8601 timestamp: "yyyy-MM-ddTHH:mm:ss" or shortened as date "yyyy-MM-dd"

Definition at line 126 of file Utils.cpp.

References _.

Referenced by Kwave::MP3Encoder::encodeID3Tags(), and Kwave::MP3Decoder::parseID3Tags().

127 {
128  const Qt::DateFormat formats[] = {
129  Qt::ISODate,
130  Qt::TextDate,
131  Qt::SystemLocaleShortDate,
132  Qt::SystemLocaleLongDate,
133  Qt::DefaultLocaleShortDate,
134  Qt::DefaultLocaleLongDate
135  };
136  QString s;
137  const unsigned int fmt_count =
138  sizeof(formats) / sizeof(formats[0]);
139  QDateTime dt;
140 
141  // try ID3 full date/time
142  dt = QDateTime::fromString(str, _("yyyy-MM-ddThh:mm:ss"));
143  if (dt.isValid())
144  return str; // already in complete date/time format
145 
146  // type ID3 date without time
147  dt = QDateTime::fromString(str, _("yyyy-MM-dd"));
148  if (dt.isValid())
149  return str; // already a valid date
150 
151  // try all date/time formats supported by Qt
152  for (unsigned int i = 0; i < fmt_count; i++) {
153  Qt::DateFormat fmt = formats[i];
154  s = QString();
155 
156  dt = QDateTime::fromString(str, fmt);
157 
158  if (dt.isValid()) {
159  // full timestamp, including time
160  s = dt.toString(_("yyyy-MM-ddThh:mm:ss"));
161  }
162  if (!s.length()) {
163  // date only, without time
164  dt = QDateTime(QDate::fromString(str), QTime(0,0));
165  s = dt.toString(_("yyyy-MM-dd"));
166  }
167 
168  if (s.length()) {
169  return s;
170  }
171  }
172 
173  return QString();
174 }
#define _(m)
Definition: memcpy.c:66
Here is the caller graph for this function:

◆ toInt()

template<typename T >
int Kwave::toInt ( x)

Convert a numeric value into an int, with range / overflow protection

Parameters
xsome numeric value, e.g. a sample_index_t or qint64
Returns
some (signed) int [INT_MIN ... INT_MAX]

Definition at line 127 of file Utils.h.

References urlScheme().

Referenced by Kwave::FileInfoDialog::accept(), Kwave::BandPassDialog::BandPassDialog(), Kwave::NotchFilterDialog::bwValueChanged(), Kwave::BandPassDialog::bwValueChanged(), Kwave::OverViewWidget::calculateBitmap(), Kwave::RecordPlugin::changeBitsPerSample(), Kwave::RecordPlugin::changeSampleRate(), Kwave::RecordPlugin::checkTrigger(), Kwave::VorbisDecoder::close(), Kwave::PlayBackPulseAudio::close(), Kwave::OpusDecoder::close(), Kwave::Filter::coeff(), Kwave::FileInfoDialog::compressionChanged(), Kwave::Parser::count(), Kwave::SonagramWindow::cursorPosChanged(), Kwave::OggDecoder::decode(), Kwave::WavDecoder::decode(), Kwave::OpusDecoder::decode(), decode_NULL(), Kwave::Filter::delay(), Kwave::SignalManager::deleteLabel(), Kwave::Signal::deleteRange(), Kwave::Signal::deleteTrack(), Kwave::LevelMeter::dequeue(), Kwave::PlayBackOSS::detectChannels(), Kwave::RecordPulseAudio::detectSampleFormats(), Kwave::RecordALSA::detectSampleFormats(), Kwave::RecordOSS::detectTracks(), Kwave::TrackPixmap::drawInterpolatedSignal(), Kwave::ScaleWidget::drawLinear(), Kwave::ScaleWidget::drawLog(), Kwave::TrackPixmap::drawOverview(), Kwave::TrackPixmap::drawPolyLineSignal(), Kwave::LevelMeter::drawScale(), Kwave::WavEncoder::encode(), Kwave::LevelMeter::enqueue(), Kwave::RecordPlugin::enqueuePrerecording(), Kwave::PlayBackPulseAudio::flush(), Kwave::PlayBackALSA::flush(), Kwave::NotchFilterDialog::freqValueChanged(), Kwave::BandPassDialog::freqValueChanged(), Kwave::RecordParams::fromList(), Kwave::OverViewCache::getOverView(), Kwave::ChannelMixer::idxInput(), Kwave::FrequencyResponseWidget::init(), Kwave::ChannelMixer::init(), Kwave::SelectTimeWidget::init(), Kwave::RecordALSA::initialize(), Kwave::RecordQt::initialize(), Kwave::PitchShiftFilter::input(), Kwave::Signal::insertSpace(), Kwave::Signal::insertTrack(), Kwave::Interpolation::interpolation(), Kwave::FileInfoDialog::isMpeg(), Kwave::MP3EncoderDialog::load(), Kwave::LowPassDialog::LowPassDialog(), Kwave::SonagramPlugin::makeAllValid(), Kwave::MemoryDialog::MemoryDialog(), Kwave::Signal::mergeStripes(), Kwave::SignalManager::modifyLabel(), Kwave::ImageView::mouseMoveEvent(), Kwave::FileInfoDialog::mpegLayerChanged(), ms2string(), Kwave::BitrateSpinBox::nearestIndex(), Kwave::BitrateWidget::nearestIndex(), Kwave::NewSignalDialog::NewSignalDialog(), Kwave::StatusWidget::nextPixmap(), Kwave::NotchFilterDialog::NotchFilterDialog(), Kwave::PlayBackOSS::open(), Kwave::AudiofileDecoder::open(), Kwave::VorbisEncoder::open(), Kwave::WavDecoder::open(), Kwave::VorbisDecoder::open(), Kwave::PlayBackQt::open(), Kwave::Signal::openReader(), Kwave::Signal::openWriter(), Kwave::LogoWidget::paintEvent(), Kwave::FrequencyResponseWidget::paintEvent(), Kwave::ImageView::paintEvent(), Kwave::CurveWidget::paintEvent(), Kwave::OpusDecoder::parseComment(), Kwave::SelectTimeWidget::percentsChanged(), Kwave::WindowFunction::points(), Kwave::ChannelMixer::port(), Kwave::RecordPlugin::processBuffer(), Kwave::RecordOSS::read(), Kwave::RecordALSA::read(), Kwave::SwapFile::read(), Kwave::RecordQt::read(), Kwave::RecordPulseAudio::read(), Kwave::PlayBackQt::Buffer::readData(), Kwave::MainWidget::refreshHorizontalScrollBar(), Kwave::Filter::resize(), Kwave::TrackPixmap::resizeBuffer(), Kwave::SampleRatePlugin::run(), Kwave::PlayBackPlugin::run(), Kwave::SignalView::samples2pixels(), Kwave::TrackPixmap::samples2pixels(), Kwave::MainWidget::samples2pixels(), Kwave::NewSignalDialog::samplesChanged(), Kwave::SelectTimeWidget::samplesChanged(), Kwave::MP3EncoderDialog::save(), Kwave::Filter::save(), Kwave::PlayBackALSA::scanDevices(), Kwave::RecordALSA::scanDevices(), Kwave::MP3EncoderDialog::selectProgram(), Kwave::Signal::selectTrack(), Kwave::FileProgress::setBytePosition(), Kwave::Filter::setCoeff(), Kwave::Filter::setDelay(), Kwave::NewSignalDialog::setHMS(), Kwave::NewSignalDialog::setLengthPercentage(), Kwave::SelectTimeWidget::setOffset(), Kwave::TrackPixmap::setOffset(), Kwave::NotchFilterDialog::setParams(), Kwave::LowPassDialog::setParams(), Kwave::BandPassDialog::setParams(), Kwave::RecordDialog::setSampleFormat(), Kwave::RecordOSS::setSampleRate(), Kwave::LevelMeter::setTracks(), Kwave::OpusEncoder::setupBitrate(), Kwave::OpusEncoder::setupCodingRate(), Kwave::FileInfoDialog::setupCompressionTab(), Kwave::OpusEncoder::setupDownMix(), Kwave::FileInfoDialog::setupFileInfoTab(), Kwave::FileInfoDialog::setupMpegTab(), Kwave::RecordPlugin::setupRecordThread(), Kwave::FileInfoDialog::setupSourceTab(), Kwave::TrackView::setVerticalZoom(), Kwave::ZoomToolBar::setZoomInfo(), Kwave::OverViewWidget::showCursor(), Kwave::TrackPixmap::slotSamplesDeleted(), Kwave::TrackPixmap::slotSamplesInserted(), Kwave::TrackPixmap::slotSamplesModified(), Kwave::SignalWidget::slotTrackDeleted(), Kwave::SignalWidget::slotTrackInserted(), Kwave::BitrateSpinBox::snapIn(), Kwave::SonagramDialog::SonagramDialog(), Kwave::RecordPlugin::startRecording(), Kwave::Signal::stripes(), Kwave::SwapFile::SwapFile(), Kwave::MP3EncoderDialog::switchToUserDefined(), Kwave::PlayBackPlugin::testPlayBack(), Kwave::NewSignalDialog::timeChanged(), Kwave::SelectTimeWidget::timeChanged(), Kwave::RecordParams::toList(), Kwave::RecordDialog::tracksChanged(), Kwave::Signal::trackSelected(), Kwave::FileInfoDialog::updateAvailableCompressions(), Kwave::RecordDialog::updateBufferState(), Kwave::VolumeDialog::updateDisplay(), Kwave::NoiseDialog::updateDisplay(), Kwave::MP3EncoderDialog::updateEncoderInfo(), Kwave::Plugin::updateProgressTick(), Kwave::SonagramWindow::updateScaleWidgets(), Kwave::PitchShiftDialog::updateSpeed(), Kwave::LevelMeter::updateTrack(), Kwave::Signal::uuidOfTrack(), Kwave::TrackPixmap::validateBuffer(), Kwave::LowPassDialog::valueChanged(), Kwave::SwapFile::write(), Kwave::PlayBackQt::Buffer::writeData(), zoom2string(), Kwave::MainWidget::zoomIn(), and Kwave::MainWidget::zoomOut().

128  {
129  const int min = std::numeric_limits<int>::min();
130  const int max = std::numeric_limits<int>::max();
131  Q_ASSERT(static_cast<qint64>(x) >= static_cast<qint64>(min));
132  Q_ASSERT(static_cast<qint64>(x) <= static_cast<qint64>(max));
133 
134  if (static_cast<qint64>(x) < static_cast<qint64>(min)) return min;
135  if (static_cast<qint64>(x) > static_cast<qint64>(max)) return max;
136 
137  return static_cast<int>(x);
138  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toUint()

template<typename T >
unsigned int Kwave::toUint ( x)

Convert a numeric value into an unsigned int, with range / overflow protection

Parameters
xsome numeric value, e.g. a sample_index_t or qint64
Returns
some unsigned int [0 ... UINT_MAX]

Definition at line 109 of file Utils.h.

Referenced by Kwave::FileContext::activated(), Kwave::SonagramWindow::adjustBrightness(), af_file_read(), af_file_write(), Kwave::SwapFile::allocate(), Kwave::MemoryManager::allocate(), Kwave::MemoryManager::allocateVirtual(), Kwave::Track::appendAfter(), Kwave::Track::appendStripe(), Kwave::VorbisDecoder::close(), Kwave::MemoryManager::convertToPhysical(), Kwave::MemoryManager::convertToVirtual(), Kwave::MetaDataList::cropByTracks(), Kwave::AudiofileDecoder::decode(), Kwave::WavDecoder::decode(), Kwave::Track::defragment(), Kwave::PlayBackQt::detectChannels(), Kwave::RecordQt::detectTracks(), Kwave::LevelMeter::drawContents(), Kwave::SampleEncoderLinear::encode(), Kwave::WavEncoder::encode(), Kwave::MP3Encoder::encode(), Kwave::FlacEncoder::encode(), Kwave::VorbisEncoder::encode(), Kwave::OpusEncoder::encode(), Kwave::SampleReader::fillBuffer(), Kwave::MP3Decoder::fillInput(), Kwave::WavEncoder::fixAudiofileBrokenHeaderBug(), Kwave::PlayBackALSA::flush(), Kwave::MemoryManager::freePhysical(), Kwave::NormalizePlugin::getMaxPower(), Kwave::OverViewCache::getMinMax(), Kwave::RecordALSA::initialize(), Kwave::RateConverter::input(), Kwave::Track::insertSpace(), Kwave::NewSignalPlugin::interpreteParameters(), Kwave::MimeData::Buffer::mapToByteArray(), Kwave::MemoryDialog::MemoryDialog(), Kwave::SampleReader::minMax(), Kwave::PlayBackALSA::open(), Kwave::MP3Decoder::open(), Kwave::PlayBackQt::open(), Kwave::Writer::operator<<(), Kwave::RecordPlugin::processBuffer(), Kwave::RecordALSA::read(), Kwave::SampleReader::read(), Kwave::RecordPulseAudio::read(), Kwave::MimeData::Buffer::readData(), Kwave::SampleReader::readSamples(), Kwave::MemoryManager::resize(), Kwave::ReversePlugin::reverseSlice(), Kwave::ZeroPlugin::run(), Kwave::DebugPlugin::run(), Kwave::PlayBackPlugin::run(), Kwave::PlaybackController::run_wrapper(), samples2string(), Kwave::OverViewCache::scaleUp(), Kwave::TrackPixmap::setOffset(), Kwave::OpusEncoder::setupEncoder(), Kwave::RecordPlugin::setupRecordThread(), Kwave::HMSTimeWidget::setValue(), Kwave::OverViewCache::slotInvalidated(), Kwave::SonagramPlugin::slotInvalidated(), Kwave::SonagramPlugin::start(), Kwave::Track::stripes(), Kwave::Stripe::StripeStorage::StripeStorage(), Kwave::PlayBackQt::supportedBits(), Kwave::PlayBackPulseAudio::supportedBits(), Kwave::RecordQt::supportedBits(), Kwave::Track::unlockedDelete(), Kwave::LevelMeter::updateTrack(), Kwave::PlayBackPulseAudio::write(), Kwave::TrackWriter::write(), Kwave::WavEncoder::writeLabels(), and Kwave::Track::writeSamples().

110  {
111  const unsigned int max = std::numeric_limits<unsigned int>::max();
112  Q_ASSERT(x >= 0);
113  Q_ASSERT(static_cast<quint64>(x) <= static_cast<quint64>(max));
114 
115  if (x <= 0) return 0;
116  if (static_cast<quint64>(x) > static_cast<quint64>(max)) return max;
117 
118  return static_cast<unsigned int>(x);
119  }
Here is the caller graph for this function:

◆ urlScheme()

QString Kwave::urlScheme ( )

returns the URL scheme for encoding/decoding kwave:<*> URLs

Definition at line 177 of file Utils.cpp.

References _.

Referenced by Kwave::Parser::fromUrl(), Kwave::TopWidget::loadFile(), Kwave::App::newWindow(), Kwave::TopWidget::newWindow(), toInt(), and Kwave::Parser::toUrl().

178 {
179  return _("kwave");
180 }
#define _(m)
Definition: memcpy.c:66
Here is the caller graph for this function:

◆ yield()

void Kwave::yield ( )

Gives the control to the next thread. This can be called from within the run() function.

Definition at line 39 of file Utils.cpp.

Referenced by Kwave::PluginManager::sync().

40 {
41  pthread_testcancel();
42  QThread::yieldCurrentThread();
43 }
Here is the caller graph for this function:

◆ zoom2string()

QString Kwave::zoom2string ( double  percent)

Converts a zoom factor into a string. The number of decimals is automatically adjusted in order to give a nice formated percent value. If the zoom factor gets too high for a reasonable display in percent, the factor is displayed as a numeric multiplier. examples: "0.1 %", "12.3 %", "468 %", "11x"

Parameters
percentthe zoom factor to be formated, a value of "100.0" means "100%", "0.1" means "0.1%" and so on.

Definition at line 46 of file Utils.cpp.

References _, toInt(), and UTF8.

Referenced by Kwave::ZoomToolBar::setZoomInfo().

47 {
48  QString result;
49 
50  if (percent < 1.0) {
51  int digits = Kwave::toInt(ceil(1.0 - log10(percent)));
52  QString format = _("%0.") + QString::number(digits) + _("f %%");
53  result = format.sprintf(UTF8(format), percent);
54  } else if (percent < 10.0) {
55  result = result.sprintf("%0.1f %%", percent);
56  } else if (percent < 1000.0) {
57  result = result.sprintf("%0.0f %%", percent);
58  } else {
59  result = result.sprintf("x %d",
60  Kwave::toInt(rint(percent / 100.0)));
61  }
62  return result;
63 }
int toInt(T x)
Definition: Utils.h:127
#define _(m)
Definition: memcpy.c:66
#define UTF8(qs)
Definition: String.h:48
Here is the call graph for this function:
Here is the caller graph for this function: