Skip to content

Commit

Permalink
Merge pull request #14 from albertolalanda/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
albertolalanda authored Sep 6, 2018
2 parents 252ff3a + 0d99e28 commit 4c04788
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 56 deletions.
5 changes: 2 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ext.versions = [
// LALANDA HERE WE CHANGE VERSIONS. SHOULD BE DONE BEFORE RELEASE. ALSO MIN SDK
versionCode : 11,
versionName : "1.3.0",
versionCode : 12,
versionName : "1.3.1",

minSdk : 14,
targetSdk : 22,
Expand Down
4 changes: 2 additions & 2 deletions ultrasonic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId 'pt.ipleiria.mymusicqoe'
// versionName versions.versionName
// versionCode versions.versionCode
versionCode 11
versionName "1.3.0"
versionCode 12
versionName "1.3.1"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
resConfigs "en", "pt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ public void run()
checkLicenseAndTrialPeriod(onValid);
}

//LALANDA FUNCTION TO DELETE MUSIC FROM CACHE
private void delete()
{
List<MusicDirectory.Entry> songs = getSelectedSongs(albumListView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ public void onClick(final View view)
@Override
protected Void doInBackground() throws Throwable
{
//LALANDA SEND ON PREVIEOUS
//getDownloadService().sendRatingMyMusicQoE(getDownloadService().getCurrentPlaying());
getDownloadService().previous();
return null;
Expand Down Expand Up @@ -406,7 +405,7 @@ protected void done(final Void result)
}
});

//LALANDA TODO TESTES PARA VER O QUÃO BEM ISTO FOI IMPLEMENTADO
// TODO TESTES PARA VER O QUÃO BEM ISTO FOI IMPLEMENTADO
// maybe this is the answer https://stackoverflow.com/questions/13532919/how-do-i-shuffle-two-arrays-in-same-order-in-java
shuffleButton.setOnClickListener(new View.OnClickListener()
{
Expand Down Expand Up @@ -446,7 +445,6 @@ public void onClick(final View view)
}
});

//LALANDA PROGRESS BAR CHANGED
progressBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@Override
Expand Down Expand Up @@ -515,7 +513,7 @@ protected void done(final Void result)
downloadService.setShufflePlayEnabled(true);
}

//LALANDA populate lists NOT NEEDED ANYMORE
// populate lists NOT NEEDED ANYMORE
/*if (downloadService != null && !downloadService.getSongs().isEmpty()){
List<DownloadFile> list = downloadService.getSongs();
Expand Down Expand Up @@ -608,7 +606,7 @@ public void onStopTrackingTouch(SeekBar seekBar) {



//LALANDA TOUCH ON THE RIGHT SEEKBAR DOENST WORK TO INVESTIGATE LATER
//Lalanda TOUCH ON THE RIGHT SEEKBAR DOENST WORK. TO INVESTIGATE LATER
// final View child = verticalSeekBar;
// verticalSeekBarParent.post(new Runnable() {
// public void run() {
Expand Down Expand Up @@ -755,7 +753,6 @@ protected void onPause()
//if (hasRated){
//the following line was redundant
//if (getDownloadService().isHasRated()){
//LALANDA to keep rating
getDownloadService().sendRatingMyMusicQoE(getDownloadService().getCurrentPlaying());
//}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public class MainActivity extends SubsonicTabActivity
private static boolean infoDialogDisplayed;
private static boolean shouldUseId3;

//LALANDA
private SharedPreferences settings;
private PreferenceCategory serversCategory;
//
Expand Down Expand Up @@ -127,7 +126,6 @@ public void onCreate(final Bundle savedInstanceState)

boolean shouldShowDialog = false;

//LALANDA HERE WE CAN CHANGE TO ALWAYS SHOW DIALOG
//shouldShowDialog = true;

if (!getActiveServerEnabled())
Expand Down Expand Up @@ -504,7 +502,7 @@ private void exit()
finish();
}

//LALANDA WELCOME TO ULTRASONIC BOX
//MyMusicQoE WELCOME TO ULTRASONIC BOX
private void showInfoDialog(final boolean show)
{
/*if (!infoDialogDisplayed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ private void onAlbumSelected(MusicDirectory.Entry album, boolean autoplay)
startActivityForResultWithoutTransition(SearchActivity.this, intent);
}

//LALANDA SEARCH ACTIVITY ADD NEW PLAYLIST
private void onSongSelected(MusicDirectory.Entry song, boolean save, boolean append, boolean autoplay, boolean playNext)
{
DownloadService downloadService = getDownloadService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,6 @@ private void enableButtons()
}

playNowButton.setVisibility(enabled ? View.VISIBLE : View.GONE);
//LALANDA REMOVE THE BUTTONS
// playNextButton.setVisibility(enabled ? View.VISIBLE : View.GONE);
// playLastButton.setVisibility(enabled ? View.VISIBLE : View.GONE);
playNextButton.setVisibility(View.GONE);
Expand Down Expand Up @@ -1185,7 +1184,6 @@ protected void done(Pair<MusicDirectory, Boolean> result)

selectButton.setVisibility(allVideos ? View.GONE : View.VISIBLE);
playNowButton.setVisibility(View.VISIBLE);
//LALANDA REMOVE BUTTONS
playNextButton.setVisibility(View.GONE);
playLastButton.setVisibility(View.GONE);
pinButton.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void onRefresh(PullToRefreshBase<ListView> refreshView)

artistListView.setOnItemClickListener(this);

//LALANDA REMOVED FOLDER BUTTON
//MyMusicQoE REMOVED FOLDER BUTTON Maybe needed for Virtual machine
// folderButton = LayoutInflater.from(this).inflate(R.layout.select_artist_header, artistListView, false);
//
// if (folderButton != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import java.util.ArrayList;
import java.util.List;

//LALANDA SELECT GENRE ACTIVITY
public class SelectGenreActivity extends SubsonicTabActivity implements AdapterView.OnItemClickListener
{
private static final String TAG = SelectGenreActivity.class.getSimpleName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ protected void done(Void result)

private void applyTheme()
{
//THEME LALANDA TODO HERE YOU SHOULD PUT THE DRAWABLES AND COLORS FOR BOTH THEMES
String theme = Util.getTheme(this);

if ("dark".equalsIgnoreCase(theme) || "fullscreen".equalsIgnoreCase(theme))
Expand Down Expand Up @@ -851,8 +850,6 @@ public void run()
{
if (!append && !playNext)
{
//LALANDA CLEAR OLD PLAYLIST SEEMS TO WORK //STILL NEED TO DO IT FOR SHUFFLE
//LALANDA DELETE TODO TODO
// final List<MusicDirectory.Entry> oldPlaylistSongs = new LinkedList<MusicDirectory.Entry>();
// for (final DownloadFile downloadFile : getDownloadService().getSongs())
// {
Expand Down Expand Up @@ -1028,9 +1025,6 @@ private void getSongsForArtist(String id, Collection<Entry> songs) throws Except
@Override
protected void done(List<Entry> songs)
{

//LALANDA DELETE TODO TODO LOOKS LIKE IT WORKS I DUNNO
System.out.println("2 DOWNLOAD RECURSiVILY DELETE");
getDownloadService().delete(songs);

if (Util.getShouldSortByDisc(SubsonicTabActivity.this))
Expand Down Expand Up @@ -1299,7 +1293,6 @@ public void uncaughtException(Thread thread, Throwable throwable)
}
}

//TODO LALANDA AQUI SÃO OS CLIQUES
@Override
public void onClick(View v)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ protected List<Genre> doInBackground() throws Throwable
@Override
protected void error(Throwable error) {
Log.w(TAG, error.toString(), error);
//LALANDA THIS IS NOT PERFECT. OPENS THE ACTIVITY AGAIN. BETTER THAN NOTHING
new ErrorDialog(getInstance(), String.format("%s", getResources().getString(R.string.background_task_no_network)), true, true);
}

Expand Down Expand Up @@ -354,7 +353,7 @@ protected Boolean doInBackground() throws Throwable {
for (int i = 0; i < userGenres.size(); i++){
Util.setFavoriteGenre(UserInformationActivity.this, listGenres[userGenres.get(i)], i);
}
//Lalanda so that REST_MUSIC_SERVICE is updated on MusicServiceFactory to show correct user id
// so that REST_MUSIC_SERVICE is updated on MusicServiceFactory to show correct user id
MusicServiceFactory.resetMusicService();
}else{
throw new java.lang.Error("Error sending the userInformation data to the server");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ private void checkSettingsChanged(Context context)
String newUrl = Util.getRestUrl(context, null);
if (!Util.equals(newUrl, restUrl))
{
///LALANDA CACHE
cachedMusicFolders.clear();
cachedMusicDirectories.clear();
cachedLicenseValid.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,9 @@ public DownloadFile(Context context, MusicDirectory.Entry song, boolean save)
this.song = song;
this.save = save;

//System.out.println("LALANDA TRANSCODINGS " + song.getApplicableTranscodings());

String[] applicableTranscodings = song.getApplicableTranscodings().split("/");

//System.out.println("LALANDA TRANSCODINGS " + applicableTranscodings.toString());


if (song.getTranscoderNum() == 0 || song.getTranscoderNum() == null){
Expand All @@ -88,14 +86,11 @@ public DownloadFile(Context context, MusicDirectory.Entry song, boolean save)
}


//LALANDA transcoded suffix pedreiro
// song.setTranscoderNum(4);
// if (song.getTranscoderNum() == 4){
// song.setTranscodedSuffix("flac");
// }
//LALANDA transcoded suffix pedreiro

// System.out.println("LALANDA RAND " + rand);
//
// if (rand == 4){
// song.setTranscodedSuffix("flac");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public class DownloadServiceImpl extends Service implements DownloadService
private final static int lockScreenBitmapSize = 500;

//--------------------------------------------------------------------------------------------//
//LALANDA RATING FOR MyMusicQoE variables
// RATING FOR MyMusicQoE variables

//SONG RATED ?, RATING GIVEN, NUMBER OF RATING FOR THIS PLAYLIST NUMBER (TO IMPLEMENT LATER)
private ArrayList<int[]> songsRatingInfo = new ArrayList<int[]>();
Expand Down Expand Up @@ -988,7 +988,7 @@ public void onFinish() {
}

setNewSong(true);
//lalanda 27 agosto poorly tested next line
// 27 agosto poorly tested next line
//hasRated = false;
}

Expand Down Expand Up @@ -1096,7 +1096,6 @@ public synchronized void next()
}
}

//LALANDA ON SONG COMPLETED DOWNLOAD!!!
private void onSongCompleted()
{
int index = getCurrentPlayingIndex();
Expand Down Expand Up @@ -1780,7 +1779,7 @@ public void onPrepared(MediaPlayer mp)
if (start)
{
mediaPlayer.start();
//LALANDA TIMER START AFTER LOADING
//TIMER START AFTER LOADING
countDownTimerPausable.start();
setPlayerState(STARTED);
}
Expand Down Expand Up @@ -1892,8 +1891,6 @@ public boolean onError(MediaPlayer mediaPlayer, int what, int extra)

final int duration = downloadFile.getSong().getDuration() == null ? 0 : downloadFile.getSong().getDuration() * 1000;


//LALANDA ON COMPLETION OF SONG MEDIAPLAYER
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
{
@Override
Expand Down Expand Up @@ -1934,10 +1931,9 @@ public void onCompletion(MediaPlayer mediaPlayer)
// //}
// }

//LALANDA SEND RATING
//SEND RATING
//sendRatingMyMusicQoE(downloadFile);

//LALANDA MAYBE I DONT NEED THIS
//setHasRated(false);
//DownloadActivity.setHasRated(false);

Expand Down Expand Up @@ -2069,7 +2065,7 @@ private void handleErrorNext(Exception x)
}


//LALANDA WHEN SHUFFLE CORNER BUTTON IS PRESSED
// WHEN SHUFFLE CORNER BUTTON IS PRESSED
protected synchronized void checkDownloads()
{
if (!Util.isExternalStoragePresent() || !lifecycleSupport.isExternalStorageAvailable())
Expand Down Expand Up @@ -2186,7 +2182,7 @@ else if (currentPlaying != downloadFile)



//LALANDA checkShufflePlay
//checkShufflePlay
private synchronized void checkShufflePlay()
{
// Get users desired random playlist size
Expand All @@ -2203,8 +2199,7 @@ private synchronized void checkShufflePlay()
for (MusicDirectory.Entry song : shufflePlayBuffer.get(listSize - size))
{
DownloadFile downloadFile = new DownloadFile(this, song, false);
//LALANDA DELETE FOR SHUFFLE (This is not max performance)
System.out.println("5 LALANDA check suffle play delete");
// DELETE FOR SHUFFLE (This is not max performance)
songs.add(downloadFile.getSong());
if (!songs.isEmpty())
{
Expand All @@ -2222,7 +2217,7 @@ private synchronized void checkShufflePlay()

}

//LALANDA INFINITE SHUFFLE LIST FOR NOW WE TAKE
// INFINITE SHUFFLE LIST FOR NOW WE TAKE IT OUT
//int currIndex = currentPlaying == null ? 0 : getCurrentPlayingIndex();
// Only shift playlist if playing song #5 or later.
/*if (currIndex > 4)
Expand Down Expand Up @@ -2273,7 +2268,6 @@ private synchronized void cleanup()
}

@SuppressWarnings("IconColors")
//LALANDA BUILD NOTIFICATION CONTROLLS
private Notification buildForegroundNotification() {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setSmallIcon(R.drawable.ic_stat_ultrasonic);
Expand Down Expand Up @@ -2349,7 +2343,6 @@ public BufferTask(DownloadFile downloadFile, int position)
this.position = position;
partialFile = downloadFile.getPartialFile();

//LALANDA BUFFER LENGTH
long bufferLength = Util.getBufferLength(DownloadServiceImpl.this);

if (bufferLength == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
/**
* @author Sindre Mehus
*/
//LALANDA INFO ON GETTING CALLS TO INVESTIGATE
public class DownloadServiceLifecycleSupport
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static SubsonicAPIClient createSubsonicApiClient(final Context context)
Constants.REST_CLIENT_ID+"-"+userID+"-API"+androidClientSDK, allowSelfSignedCertificate,
enableLdapUserSupport, BuildConfig.DEBUG);
}
//.LALANDA API LEVEL IS SENT HERE AND USER ID since 1.1.0
//.MyMusicQoE API LEVEL IS SENT HERE AND USER ID since 1.1.0
return new SubsonicAPIClient(serverUrl, username, password,
SubsonicAPIVersions.fromApiVersion(Constants.REST_PROTOCOL_VERSION),
Constants.REST_CLIENT_ID+"-"+userID+"-API"+androidClientSDK, allowSelfSignedCertificate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,6 @@ public static int getDefaultArtists(Context context)
return 3;
}

//GET BUFFER LENGTH LALANDA TODO VER COMO ISTO FUNCIONA PARA O RELATORIO
public static int getBufferLength(Context context)
{
// SharedPreferences preferences = getPreferences(context);
Expand Down Expand Up @@ -1591,7 +1590,6 @@ public static boolean getShouldTransitionOnPlaybackPreference(Context context)
return true;
}

//LALANDA NEVER USE ID3 ALWAYS FILE SYSTEM BASED METHODS
//SINCE 1.1.0 WE USE ID3Tags
public static boolean getShouldUseId3Tags(Context context)
{
Expand Down
2 changes: 1 addition & 1 deletion ultrasonic/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<string name="main.videos">Vídeos</string>
<string name="main.welcome_text">O objectivo do <b>MyMusicQoE</b> é recolher estatísticas da qualidade do aúdio na transmissão de música. Se quiser saber mais, visite a nossa página <b>Sobre</b>, disponível no menu lateral. Antes de poder usar a aplicação, preencha um pequeno formulário.</string>
<string name="main.welcome_title">Bem-vindo ao MyMusicQoE!</string>
<string name="download.info_text">Nesta página conseguirá ouvir músicas que poderão ter uma variedade de qualidade de áudio. Após 10 segundos haverá a possibilidade de classificar o áudio da música que estiver a ouvir nesse momento, no entanto é recomendado que ouça a faixa em questão na sua totalidade.</string>
<string name="download.info_text">Nesta página conseguirá ouvir músicas com qualidades de áudio variavel. Após 10 segundos, na reprodução de uma música, haverá a possibilidade de classificar o áudio, no entanto é recomendado que ouça a faixa em questão na sua totalidade.</string>
<string name="download.info_title">Como Funciona</string>
<string name="menu.about">Sobre</string>
<string name="menu.common">Diversos</string>
Expand Down
1 change: 0 additions & 1 deletion ultrasonic/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@
<item quantity="other">%d songs selected to be pinned.</item>
</plurals>

<!--LALANDA WHAT TO DO ABOUT THIS TRANSLATIONS-->
<plurals name="select_album_n_songs_downloaded">
<item quantity="one">1 song selected to be downloaded.</item>
<item quantity="other">%d songs selected to be downloaded.</item>
Expand Down

0 comments on commit 4c04788

Please sign in to comment.