mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +02:00
some more testing work for stations
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import QtQuick 1.1
|
import QtQuick 1.1
|
||||||
import tomahawk 1.0
|
import tomahawk 1.0
|
||||||
|
import "tomahawkimports"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: scene
|
id: scene
|
||||||
@@ -7,14 +8,84 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
state: echonestStation.configured ? "list" : "configure"
|
state: echonestStation.configured ? "list" : "configure"
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: styleModel
|
||||||
|
ListElement { modelData: "acoustic" }
|
||||||
|
ListElement { modelData: "alternative" }
|
||||||
|
ListElement { modelData: "alternative rock" }
|
||||||
|
ListElement { modelData: "classic" }
|
||||||
|
ListElement { modelData: "folk" }
|
||||||
|
ListElement { modelData: "indie" }
|
||||||
|
ListElement { modelData: "pop" }
|
||||||
|
ListElement { modelData: "rock" }
|
||||||
|
ListElement { modelData: "hip-hop" }
|
||||||
|
ListElement { modelData: "punk" }
|
||||||
|
ListElement { modelData: "grunge" }
|
||||||
|
ListElement { modelData: "indie" }
|
||||||
|
ListElement { modelData: "electronic" }
|
||||||
|
ListElement { modelData: "country" }
|
||||||
|
ListElement { modelData: "jazz" }
|
||||||
|
ListElement { modelData: "psychodelic" }
|
||||||
|
ListElement { modelData: "soundtrack" }
|
||||||
|
ListElement { modelData: "reggae" }
|
||||||
|
ListElement { modelData: "house" }
|
||||||
|
ListElement { modelData: "drum and base" }
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: dummyArtistModel
|
||||||
|
ListElement { modelData: "Pink Floyd" }
|
||||||
|
ListElement { modelData: "Tool" }
|
||||||
|
ListElement { modelData: "Cake" }
|
||||||
|
ListElement { modelData: "Metallica" }
|
||||||
|
ListElement { modelData: "Red Hot Chili Peppers" }
|
||||||
|
ListElement { modelData: "Korn" }
|
||||||
|
ListElement { modelData: "Prodigy" }
|
||||||
|
ListElement { modelData: "Otto Waalkes" }
|
||||||
|
}
|
||||||
|
|
||||||
VisualItemModel {
|
VisualItemModel {
|
||||||
id: stationVisualModel
|
id: stationVisualModel
|
||||||
|
|
||||||
TagCloud {
|
|
||||||
|
Column {
|
||||||
height: scene.height
|
height: scene.height
|
||||||
width: scene.width
|
width: scene.width
|
||||||
model: generator.styles()
|
|
||||||
|
Row {
|
||||||
|
height: scene.height / 2
|
||||||
|
width: scene.width
|
||||||
|
spacing: width * .1
|
||||||
|
|
||||||
|
GridView {
|
||||||
|
id: gridView
|
||||||
|
height: parent.height
|
||||||
|
width: (parent.width - orText.width - parent.spacing * 2 ) * 2 / 3
|
||||||
|
model: dummyArtistModel
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
height: gridView.height / 3;
|
||||||
|
width: height
|
||||||
|
|
||||||
|
CoverImage {
|
||||||
|
artistName: modelData
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
height: scene.height / 2
|
||||||
|
width: scene.width * .9
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: width * .1
|
||||||
|
|
||||||
|
TagCloud {
|
||||||
|
height: parent.height
|
||||||
|
width: (parent.width - orText.width - parent.spacing * 2 ) * 2 / 3
|
||||||
|
model: styleModel//generator.styles()
|
||||||
opacity: echonestStation.configured ? 0 : 1
|
opacity: echonestStation.configured ? 0 : 1
|
||||||
|
|
||||||
onTagClicked: {
|
onTagClicked: {
|
||||||
@@ -26,6 +97,18 @@ Rectangle {
|
|||||||
NumberAnimation { duration: 300 }
|
NumberAnimation { duration: 300 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Text {
|
||||||
|
id: orText
|
||||||
|
text: "or"
|
||||||
|
color: "white"
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
InputField {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: (parent.width - orText.width - parent.spacing * 2 ) * 1 / 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StationView {
|
StationView {
|
||||||
coverSize: Math.min(scene.height, scene.width) / 2
|
coverSize: Math.min(scene.height, scene.width) / 2
|
||||||
|
@@ -15,43 +15,25 @@ Item {
|
|||||||
|
|
||||||
Flow {
|
Flow {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width - 100
|
width: parent.width
|
||||||
//model: controlModel
|
|
||||||
spacing: 3
|
spacing: 3
|
||||||
|
|
||||||
Timer {
|
|
||||||
interval: 5000
|
|
||||||
running: false
|
|
||||||
repeat: true
|
|
||||||
|
|
||||||
onTriggered: {
|
|
||||||
for(var i = 0; i < cloudRepeater.count; i++) {
|
|
||||||
var item = cloudRepeater.itemAt(i);
|
|
||||||
if(item.itemScale > 0.6) {
|
|
||||||
item.itemScale = Math.random();
|
|
||||||
} else {
|
|
||||||
item.itemScale = Math.random();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: cloudRepeater
|
id: cloudRepeater
|
||||||
model: tagCloud.model
|
model: tagCloud.model
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: cloudItem
|
id: cloudItem
|
||||||
width: delegateText.width * scale
|
width: delegateText.width * 1.1
|
||||||
height: 28
|
height: delegateText.height
|
||||||
property double itemScale: Math.random()
|
property double itemScale: Math.random() + .3
|
||||||
scale: itemScale
|
scale: itemScale
|
||||||
Text {
|
Text {
|
||||||
id: delegateText
|
id: delegateText
|
||||||
color: "white"
|
color: "white"
|
||||||
//text: controlModel.controlAt( index ).summary
|
//text: controlModel.controlAt( index ).summary
|
||||||
text: modelData
|
text: modelData
|
||||||
font.pixelSize: 28
|
font.pointSize: 16
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.verticalCenterOffset: tagCloud.randomNumber(0, 15)
|
anchors.verticalCenterOffset: tagCloud.randomNumber(0, 15)
|
||||||
}
|
}
|
||||||
@@ -60,16 +42,6 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: tagCloud.tagClicked( modelData )
|
onClicked: tagCloud.tagClicked( modelData )
|
||||||
|
|
||||||
onMousePositionChanged: {
|
|
||||||
cloudItem.scale = 1;
|
|
||||||
delegateTimer.restart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: delegateTimer
|
|
||||||
interval: 3000
|
|
||||||
repeat: false
|
|
||||||
onTriggered: cloudItem.scale = cloudItem.itemScale
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
@@ -729,6 +729,7 @@ PlayableModel::finishLoading()
|
|||||||
PlayableItem*
|
PlayableItem*
|
||||||
PlayableModel::itemFromIndex( const QModelIndex& index ) const
|
PlayableModel::itemFromIndex( const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(index.isValid());
|
||||||
if ( index.isValid() )
|
if ( index.isValid() )
|
||||||
{
|
{
|
||||||
return static_cast<PlayableItem*>( index.internalPointer() );
|
return static_cast<PlayableItem*>( index.internalPointer() );
|
||||||
|
@@ -60,7 +60,6 @@ DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* pa
|
|||||||
rootContext()->setContextProperty( "echonestStation", station);
|
rootContext()->setContextProperty( "echonestStation", station);
|
||||||
rootContext()->setContextProperty( "dynamicModel", m_proxyModel );
|
rootContext()->setContextProperty( "dynamicModel", m_proxyModel );
|
||||||
rootContext()->setContextProperty( "generator", m_playlist->generator().data() );
|
rootContext()->setContextProperty( "generator", m_playlist->generator().data() );
|
||||||
currentItemChanged( m_model->currentItem() );
|
|
||||||
|
|
||||||
setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) );
|
setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user