RB.History¶
Subclasses: | None |
---|
Methods¶
Inherited: | GObject.Object (37) |
---|---|
Structs: | GObject.ObjectClass (5) |
class | new (truncate_on_play, destroyer, *destroy_userdata) |
append (entry) |
|
clear () |
|
contains_entry (entry) |
|
current () |
|
dump () |
|
first () |
|
get_current_index () |
|
go_first () |
|
go_last () |
|
go_next () |
|
go_previous () |
|
insert_at_index (entry, index) |
|
last () |
|
length () |
|
next () |
|
previous () |
|
remove_entry (entry) |
|
set_destroy_notify (destroyer, *destroy_userdata) |
|
set_maximum_size (maximum_size) |
|
set_playing (entry) |
|
set_truncate_on_play (truncate_on_play) |
Virtual Methods¶
Inherited: | GObject.Object (7) |
---|
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
maximum-size |
int |
r/w | Maximum length of the history. Infinite if 0 |
truncate-on-play |
bool |
r/w/c | Whether RB.History.set_playing () truncates the rest of the list |
Signals¶
Inherited: | GObject.Object (1) |
---|
Class Details¶
-
class
RB.
History
(**kwargs)¶ Bases: GObject.Object
Abstract: No Structure: RB.HistoryClass
-
classmethod
new
(truncate_on_play, destroyer, *destroy_userdata)¶ Parameters: - truncate_on_play (
bool
) – WhetherRB.History.set_playing
() should truncate the history - destroyer (
GLib.Func
) – function to call when removing an entry from the history - destroy_userdata (
object
orNone
) – data to pass to destroyer
Returns: a new
RB.History
Return type: Creates a new history instance.
- truncate_on_play (
-
append
(entry)¶ Parameters: entry ( RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to appendAdds a new entry to the end of the history list. If a size limit is set, an entry may be removed from the start to keep the history list within the limit.
-
clear
()¶ Empties the history list.
-
contains_entry
(entry)¶ Parameters: entry ( RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to check forReturns: True
if foundReturn type: bool
Returns
True
if the entry is present in the history list.
-
current
()¶ Returns: current entry or None
Return type: RB.RhythmDBEntry
Returns the current
RB.RhythmDBEntry
, orNone
if there is no current position
-
dump
()¶ Returns: a copy of the history list Return type: [ RB.RhythmDBEntry
]Constructs a copy of the whole history in order. Caller must free the result. The caller does not own any references on the entries in the returned array. Takes O(Nlog(N)) time.
-
first
()¶ Returns: first entry Return type: RB.RhythmDBEntry
Returns the first entry in the history.
-
get_current_index
()¶ Returns: index of the current entry Return type: int
Gets the index of the current entry. This is guaranteed to be < the history’s size, so if the history is empty, it returns -1.
-
go_first
()¶ Moves the current position to the first entry in the history
-
go_last
()¶ Moves the current position to the last entry in the history
-
go_next
()¶ Moves the current position to the next entry. If the current position is already at the end of the history, nothing happens.
-
go_previous
()¶ Moves the current position to the previous entry. If the current position is already at the start of the history, nothing happens.
-
insert_at_index
(entry, index)¶ Parameters: - entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to insert - index (
int
) – position at which to insert entry
Inserts entry at index within the history list. 0<=`index`<=size
- entry (
-
last
()¶ Returns: last entry Return type: RB.RhythmDBEntry
Returns the last
RB.RhythmDBEntry
in the history
-
next
()¶ Returns: next entry Return type: RB.RhythmDBEntry
Returns the
RB.RhythmDBEntry
after the current position
-
previous
()¶ Returns: previous entry Return type: RB.RhythmDBEntry
Returns the
RB.RhythmDBEntry
before the current position.
-
remove_entry
(entry)¶ Parameters: entry ( RB.RhythmDBEntry
) – theRB.RhythmDBEntry
to removeRemoves the specified entry from the history list.
-
set_destroy_notify
(destroyer, *destroy_userdata)¶ Parameters: Sets a new function to call when removing entries from the history.
-
set_maximum_size
(maximum_size)¶ Parameters: maximum_size ( int
) – new maximum size of the history (or 0 for no limit)Sets the maximum-size property
-
set_playing
(entry)¶ Parameters: entry ( RB.RhythmDBEntry
) – the new playingRB.RhythmDBEntry
Updates the current position to point to the specified entry. If the truncate-on-play property is set, this will remove all entries after that.
-
set_truncate_on_play
(truncate_on_play)¶ Parameters: truncate_on_play ( bool
) – WhetherRB.History.set_playing
() should truncate the historySets the ‘truncate-on-play’ property.
-
classmethod