QOrbitermanager: Difference between revisions
Appearance
Langstonius (talk | contribs) |
Langstonius (talk | contribs) |
||
| Line 5: | Line 5: | ||
Functions and Properties can be accessed via '''manager.function()''' or '''manager.propertyName''' | Functions and Properties can be accessed via '''manager.function()''' or '''manager.propertyName''' | ||
=Properties= | =Properties= | ||
{| class="wikitable" | |||
|+ Properties are accessed by: dceTimecode.propertyname | |||
! Property Name | |||
! Property Type | |||
! Signal | |||
! Description | |||
! Example | |||
|- | |||
| tcTotalTime | |||
| int | |||
| totalTimeChanged() | |||
| the total time, in milliseconds of the current media | |||
| Here i use the total time to calculate the time when dragging the seek bar back and forth | |||
property int slidertimer: (scroll_tab.x / scroller_transit.width) * dceTimecode.tcTotalTime | |||
|- | |||
| tcCurrentTime | |||
| int | |||
| timeChanged() | |||
| the current position, in milliseconds | |||
|- | |||
| runningTimer | |||
| double | |||
| positionChanged() | |||
| Used to constantly update the position of the seek bar as media advances | |||
| By setting the x property to do a little math, I get the seek bar to advance across the transit as the media plays | |||
x: ( dceTimecode.runningTimer / dceTimecode.tcTotalTime) * scroller.width | |||
|- | |||
| dragTime | |||
| String | |||
| dragTimeChanged() | |||
| the time that the slider if implemented has been dragged to. | |||
| Here, it is utilized in a popup that shows when a user drags the seek bar | |||
Text { | |||
id: drag_label | |||
text: dceTimecode.dragTime | |||
anchors.centerIn: parent | |||
} | |||
|- | |||
| qsTotalTime | |||
| String | |||
| totalStringTimeChanged() | |||
| Total time of media, formatted in HH::MM::SS - updated every second | |||
|- | |||
| qsCurrentTime | |||
| String | |||
| stringTimeChanged() | |||
| The current position of the media in HH:MM::SS - updated every second | |||
|- | |||
| stringPlaybackSpeed | |||
| string | |||
|sPlaybackSpeedChanged() | |||
| Playback speed in string format | |||
|- | |||
| playbackSpeed | |||
| int | |||
| playbackSpeedChanged() | |||
| Playback Speed in integer format | |||
|} | |||
==Signals== | |||
Signals not related to specific properties, but internal functions of the class itself | |||
{| class="wikitable" | |||
! Signal | |||
! Params | |||
! Description | |||
|- | |||
| seekToTime(QString) | |||
| String | |||
| This signal is emitted when the dragging stops on the seek bar and the time to jump to in the stream is calculated. The string contains the time to jump to in milliseconds. This signal is normally connected to the dce function setMediaPosition(QString) | |||
|} | |||
=Signals= | =Signals= | ||
Revision as of 20:54, 3 October 2012
QOrbiter manager is what it sounds like. It manages the flow of operations in QOrbiter between the different context objects and the threaded dce side of the program. It can be accessed through 'manager'
QorbiterManger is the Qt object responsible for managing the initial setup state of the orbiter, as well as containing some key properties and signals. It is also used and an intermediary object, emitting cross thread signals from the UI to prevent blocking operations.
Functions and Properties can be accessed via manager.function() or manager.propertyName
Properties
| Property Name | Property Type | Signal | Description | Example |
|---|---|---|---|---|
| tcTotalTime | int | totalTimeChanged() | the total time, in milliseconds of the current media | Here i use the total time to calculate the time when dragging the seek bar back and forth
property int slidertimer: (scroll_tab.x / scroller_transit.width) * dceTimecode.tcTotalTime |
| tcCurrentTime | int | timeChanged() | the current position, in milliseconds | |
| runningTimer | double | positionChanged() | Used to constantly update the position of the seek bar as media advances | By setting the x property to do a little math, I get the seek bar to advance across the transit as the media plays
x: ( dceTimecode.runningTimer / dceTimecode.tcTotalTime) * scroller.width |
| dragTime | String | dragTimeChanged() | the time that the slider if implemented has been dragged to. | Here, it is utilized in a popup that shows when a user drags the seek bar
Text {
id: drag_label
text: dceTimecode.dragTime
anchors.centerIn: parent
}
|
| qsTotalTime | String | totalStringTimeChanged() | Total time of media, formatted in HH::MM::SS - updated every second | |
| qsCurrentTime | String | stringTimeChanged() | The current position of the media in HH:MM::SS - updated every second | |
| stringPlaybackSpeed | string | sPlaybackSpeedChanged() | Playback speed in string format | |
| playbackSpeed | int | playbackSpeedChanged() | Playback Speed in integer format |
Signals
Signals not related to specific properties, but internal functions of the class itself
| Signal | Params | Description |
|---|---|---|
| seekToTime(QString) | String | This signal is emitted when the dragging stops on the seek bar and the time to jump to in the stream is calculated. The string contains the time to jump to in milliseconds. This signal is normally connected to the dce function setMediaPosition(QString) |
Signals
Functions
| void getLiveTVPlaylist(') | ||
| Params | Description | EX |
| No Params | Calling this function will tell the router to populate the live tv playlist and return it to the playlist element. Calling it when no tv is playing has no result | Component.onCompleted:manager.getLiveTVPlaylist() |
| void showFloorplan(int floorplantype) | ||
| Params | Description | Example |
| int - The type of floorplan you want to display | This function brings up the floorplan for the selected room and populates the devices there on the screenshot image | |
| void saveScreenshot(int attribute_number) | ||
| Params | Description | Example |
| int - The Attribute number of the attribute you want to associate with the screenshot. It is provided in the screenshotAttributes listmodel that is prepared when grabbing a screeshot |
Saves the current screenshot to the attribute image |
Component {
id:thumbdelegate
Rectangle{
id:attributedelegate
height: 50
width: parent.width-1
color: style.accentcolor
Text {
id: propertystring
text: attributeType
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
onEntered: attributedelegate.color = "aliceblue"
onExited: attributedelegate.color = style.accentcolor
onClicked: {
manager.saveScreenShot(attributeNo)
manager.cleanupScreenie()
assignscreenshot.destroy()
}
}
}
}
|
| void cleanupScreenie(') | ||
| Params | Description | Output |
| None | Destroys the last screenshot and empties the model. Depreciated and will be made automatic | |
| void resendCode(int parentDevice, int commandNumber) | ||
| Params | Description | Output |
| parentDevice - int - device number of the parent
commandNumber- int - the number of the command you wish to resend |
Resend and av control code. This function should be utilized within the device_commands model. The parameters are attributes of said mdel |
ListView
{
id:device_command_list
height: parent.height
width: scaleX(10)
anchors.top: parent.top
anchors.left: codelist.right
anchors.leftMargin: scaleY(5)
clip: true
model: device_commands
delegate: Rectangle{
id:device_box
height: scaleY(8)
width: scaleX(20)
color: "slateblue"
Column{
spacing: scaleY(1)
Text{
id:command_label
text:qs_command
font.pixelSize: scaleY(2)
}
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
onEntered: device_box.color = "white"
onExited: device_box.color = "slateblue"
onClicked: manager.resendCode(i_parentDevice, i_commandnum)
}
}
}
|