Skip to content

Commit

Permalink
Cleanup code for v0.4 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Micahnator committed Jan 17, 2016
1 parent b0ee369 commit ff8aa7c
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 623 deletions.
37 changes: 1 addition & 36 deletions panpipe.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ MainView {
if(("Unknown" == pandoraUsername) || ("Unknown" == pandoraPassword)) {
appView.requestCredentials();
} else {
//pandoraInterface.login(pandoraUsername, pandoraPassword);
pandoraBackend.login(pandoraUsername, pandoraPassword);
}
}
Expand All @@ -96,16 +95,6 @@ MainView {

selectedAudioStream: selectedStream

onStationsUpdated: {
console.log("Micah, we got stations!");

console.log(stationsData);
}

onPlaylistDataChanged: {
console.log("Micah, we received some playlist data!");
}

onLoginSuccess: {
if(!success) {
appView.requestCredentials(_lastAttemptedUsername);
Expand All @@ -122,27 +111,7 @@ MainView {
/* Audio component */
Audio {
id: audioPlayer
// source: pandoraBackend.currentSongAudioUrl
playlist: pandoraBackend.playlist
// autoPlay: true

// onItemChanged: {
// play();
// }

// onSourceChanged: {
// console.log("\nAudio source changed to: ", source, "\n");
// }

// onPlaybackStateChanged: {
// console.log("\nAudio playback state changed to: ", playbackState, "\n");
// }

// playlist: Playlist {
// id: playlist
// playbackMode: Playlist.Sequential

// }

onStatusChanged: {
switch (audioPlayer.status) {
Expand Down Expand Up @@ -250,13 +219,10 @@ MainView {

/* Action functions */
function logout() {
// /* Clear audio component */
/* Stop the audio component */
audioPlayer.stop();
// audioPlayer.source = "";
// audioPlayer.

/* Clear pandora interface */
// pandoraInterface.logout();
pandoraBackend.logout();

/* Clear the UI */
Expand All @@ -267,7 +233,6 @@ MainView {
Storage.setSetting("pandora_password", "Unknown");

/* Request login credentials */
// viewComponent.requestCredentials(_lastAttemptedUsername);
appView.requestCredentials(_lastAttemptedUsername);
}
}
88 changes: 1 addition & 87 deletions panpipe_core/PanpipeCore.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2015 Micah Losli <micah.losli@gmail.com>
Copyright (C) 2015-2016 Micah Losli <micah.losli@gmail.com>
This file is part of Panpipe.
Expand All @@ -21,7 +21,6 @@ import QtQuick 2.4

import "models"
import "pandora"

import "./AudioStream.js" as AudioStream

Item {
Expand Down Expand Up @@ -64,18 +63,9 @@ Item {
property string currentStationName

property var currentSongItem
// property string currentSongAudioUrl:_selectAudioUrl(currentSong)
property string currentSongArtist
property string selectedAudioStream

/* Private properties */


/* Initialization */
// Component.onCompleted: {
// selectedAudioStream = AudioStream.Streams.DFLT_MED;

// }

/* Pandora interface component */
PandoraInterface {
Expand Down Expand Up @@ -133,10 +123,6 @@ Item {
}
}

// onSelectedAudioStreamChanged: {
// currentStationPlaylist.pandoraInterface.audioStreamString = selectedAudioStream;
// }


/* Public method implementations */
function login(username, password) {
Expand Down Expand Up @@ -181,85 +167,13 @@ Item {
function giveFeedback(favorable, trackToken) {
/* Update data model */
if(favorable) {
// playlistData[playlistCurrentIndex].songRating = 1;
currentStationPlaylist.currentPlaylistItem.songRating = 1;
} else {
// playlistData[playlistCurrentIndex].songRating = -1;
currentStationPlaylist.currentPlaylistItem.songRating = -1;
}

/* Send the feedback to Pandora */
// Pandora.sendFeedback(favorable, trackToken, null);
pandoraInterfaceComponent.giveFeedback(favorable, trackToken, null);
}


/* Private methods */
// function _selectAudioUrl(currentSongObject) {
// if(connected) {
// var selectedUrl

// switch(selectedAudioStream) {
// case AudioStream.Streams.DFLT_LOW:
// console.log("Using low stream");
// selectedUrl = currentSongObject.audioUrlMap.lowQuality.audioUrl;
// break;
// case AudioStream.Streams.DFLT_MED:
// console.log("Using medium stream");
// selectedUrl = currentSongObject.audioUrlMap.mediumQuality.audioUrl;
// break;
// case AudioStream.Streams.DFLT_HI:
// console.log("Using hight stream");
// selectedUrl = currentSongObject.audioUrlMap.highQuality.audioUrl;
// break;
// case AudioStream.Streams.AAC_MONO_40:
// console.log("Using AAC mono stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.aacMono;
// break;
// case AudioStream.Streams.AAC_64:
// console.log("Using AAC 64 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.aac64;
// break;
// case AudioStream.Streams.AACP_32:
// console.log("Using AACP 32 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.aacp32;
// break;
// case AudioStream.Streams.AACP_64:
// console.log("Using AACP 64 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.aacp64;
// break;
// case AudioStream.Streams.AACP_ADTS_24:
// console.log("Using ADTS 24 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.adts24;
// break;
// case AudioStream.Streams.AACP_ADTS_32:
// console.log("Using ADTS 32 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.adts32;
// break;
// case AudioStream.Streams.AACP_ADTS_64:
// console.log("Using ADTS 64 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.adts64;
// break;
// case AudioStream.Streams.MP3_128:
// console.log("Using MP3 stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.mp3;
// break;
// case AudioStream.Streams.WMA_32:
// console.log("Using WMA stream");
// selectedUrl = currentSongObject.audioUrlMap.extraUrls.wma;
// break;
// default:
// console.log("Using default stream");
// selectedUrl = currentSongObject.audioUrlMap.lowQuality.audioUrl;
// break;
// }
// }
// else {
// console.log("Not connected, returning empty url");
// return "";
// }

// return selectedUrl;
// }

}
Loading

0 comments on commit ff8aa7c

Please sign in to comment.