Rename to Vanilla Music

This commit is contained in:
Christopher Eby 2010-02-21 19:41:59 -06:00
parent 009c5d54e4
commit 44ebddbc14
22 changed files with 78 additions and 59 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Tumult</name>
<name>VanillaMusic</name>
<comment></comment>
<projects>
</projects>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kreed.tumult"
android:versionCode="1" android:versionName="1.0">
package="org.kreed.vanilla"
android:versionCode="1" android:versionName="0.1">
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:name="Tumult">
android:name="ContextApplication">
<activity
android:name="NowPlayingActivity"
android:theme="@style/NoBackground"
@ -26,4 +26,4 @@
</application>
<uses-sdk android:minSdkVersion="3"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
</manifest>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<org.kreed.tumult.CoverView
<org.kreed.vanilla.CoverView
android:id="@+id/cover_view"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<org.kreed.tumult.RemoteLayout
<org.kreed.vanilla.RemoteLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<org.kreed.tumult.CoverView
<org.kreed.vanilla.CoverView
android:id="@+id/cover_view"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
@ -28,4 +28,4 @@
android:layout_width="wrap_content"
android:text="@string/stop_service" />
</LinearLayout>
</org.kreed.tumult.RemoteLayout>
</org.kreed.vanilla.RemoteLayout>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Tumult</string>
<string name="app_name">Vanilla Music</string>
<string name="enqueued">Enqueued %s</string>
<string name="filter">Filter: </string>

View File

@ -1,3 +0,0 @@
package org.kreed.tumult;
parcelable Song;

View File

@ -1,18 +0,0 @@
package org.kreed.tumult;
import android.app.Application;
import android.content.Context;
public class Tumult extends Application {
private static Tumult instance;
public Tumult()
{
instance = this;
}
public static Context getContext()
{
return instance;
}
}

View File

@ -0,0 +1,18 @@
package org.kreed.vanilla;
import android.app.Application;
import android.content.Context;
public class ContextApplication extends Application {
private static ContextApplication instance;
public ContextApplication()
{
instance = this;
}
public static Context getContext()
{
return instance;
}
}

View File

@ -1,4 +1,7 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.vanilla.IMusicPlayerWatcher;
import org.kreed.vanilla.IPlaybackService;
import android.content.Context;
import android.graphics.Bitmap;
@ -164,7 +167,7 @@ public class CoverView extends View {
mSongs = mService.getCurrentSongs();
regenerateBitmaps();
} catch (RemoteException e) {
Log.e("Tumult", "RemoteException", e);
Log.e("VanillaMusic", "RemoteException", e);
}
}

View File

@ -1,6 +1,6 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.tumult.Song;
import org.kreed.vanilla.Song;
oneway interface IMusicPlayerWatcher {
void songChanged(in Song playingSong);

View File

@ -1,7 +1,7 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.tumult.Song;
import org.kreed.tumult.IMusicPlayerWatcher;
import org.kreed.vanilla.Song;
import org.kreed.vanilla.IMusicPlayerWatcher;
interface IPlaybackService {
void registerWatcher(IMusicPlayerWatcher watcher);

View File

@ -1,4 +1,8 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.vanilla.IMusicPlayerWatcher;
import org.kreed.vanilla.IPlaybackService;
import org.kreed.vanilla.R;
import android.app.Activity;
import android.content.ComponentName;
@ -53,7 +57,7 @@ public class NowPlayingActivity extends Activity implements ServiceConnection, V
{
super.onCreate(icicle);
setContentView(R.layout.nowplaying);
setContentView(R.layout.now_playing);
mCoverView = (CoverView)findViewById(R.id.cover_view);
mCoverView.setOnClickListener(this);
@ -204,7 +208,7 @@ public class NowPlayingActivity extends Activity implements ServiceConnection, V
state = service.getState();
mDuration = service.getDuration();
} catch (RemoteException e) {
Log.i("Tumult", "Failed to initialize connection to playback service", e);
Log.i("VanillaMusic", "Failed to initialize connection to playback service", e);
return;
}
}

View File

@ -1,4 +1,4 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
@ -6,6 +6,10 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Random;
import org.kreed.vanilla.IMusicPlayerWatcher;
import org.kreed.vanilla.IPlaybackService;
import org.kreed.vanilla.R;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@ -177,9 +181,9 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
try {
mStartForeground.invoke(this, startForegroundArgs);
} catch (InvocationTargetException e) {
Log.w("Tumult", "Unable to invoke startForeground", e);
Log.w("VanillaMusic", "Unable to invoke startForeground", e);
} catch (IllegalAccessException e) {
Log.w("Tumult", "Unable to invoke startForeground", e);
Log.w("VanillaMusic", "Unable to invoke startForeground", e);
}
}
}
@ -194,9 +198,9 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
try {
mStopForeground.invoke(this, topForegroundArgs);
} catch (InvocationTargetException e) {
Log.w("Tumult", "Unable to invoke stopForeground", e);
Log.w("VanillaMusic", "Unable to invoke stopForeground", e);
} catch (IllegalAccessException e) {
Log.w("Tumult", "Unable to invoke stopForeground", e);
Log.w("VanillaMusic", "Unable to invoke stopForeground", e);
}
}
}
@ -296,7 +300,7 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
} else {
Song song = new Song(message.arg1);
String text = getResources().getString(R.string.enqueued, song.title);
Toast.makeText(Tumult.getContext(), text, Toast.LENGTH_SHORT).show();
Toast.makeText(ContextApplication.getContext(), text, Toast.LENGTH_SHORT).show();
int i = mCurrentSong + 1 + mQueuePos++;
if (i < mSongTimeline.size())
@ -339,7 +343,7 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
registerReceiver(mReceiver, filter);
PowerManager powerManager = (PowerManager)getSystemService(POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "TumultSongChangeLock");
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VanillaMusicSongChangeLock");
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setWakeMode(this, PowerManager.PARTIAL_WAKE_LOCK);
@ -446,7 +450,7 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
if (mState == STATE_PLAYING)
play();
} catch (IOException e) {
Log.e("Tumult", "IOException", e);
Log.e("VanillaMusic", "IOException", e);
}
int i = mWatchers.beginBroadcast();

View File

@ -1,4 +1,6 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.vanilla.R;
import android.os.Bundle;
import android.preference.PreferenceActivity;

View File

@ -1,4 +1,8 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.vanilla.IMusicPlayerWatcher;
import org.kreed.vanilla.IPlaybackService;
import org.kreed.vanilla.R;
import android.app.Activity;
import android.content.ComponentName;

View File

@ -1,4 +1,4 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import android.content.Context;
import android.util.AttributeSet;

View File

@ -0,0 +1,3 @@
package org.kreed.vanilla;
parcelable Song;

View File

@ -1,4 +1,4 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import android.content.ContentResolver;
import android.database.Cursor;
@ -27,7 +27,7 @@ public class Song implements Parcelable {
};
String selection = MediaStore.Audio.Media._ID + "==" + id;;
ContentResolver resolver = Tumult.getContext().getContentResolver();
ContentResolver resolver = ContextApplication.getContext().getContentResolver();
Cursor cursor = resolver.query(media, projection, selection, null, null);
if (cursor != null && cursor.moveToNext()) {
@ -56,7 +56,7 @@ public class Song implements Parcelable {
String[] projection = { MediaStore.Audio.Media._ID };
String selection = MediaStore.Audio.Media.IS_MUSIC + "!=0";
ContentResolver resolver = Tumult.getContext().getContentResolver();
ContentResolver resolver = ContextApplication.getContext().getContentResolver();
Cursor cursor = resolver.query(media, projection, selection, null, null);
if (cursor == null)
@ -117,4 +117,4 @@ public class Song implements Parcelable {
{
return 0;
}
}
}

View File

@ -1,4 +1,4 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,4 +1,6 @@
package org.kreed.tumult;
package org.kreed.vanilla;
import org.kreed.vanilla.R;
import android.app.Activity;
import android.content.Intent;
@ -28,7 +30,7 @@ public class SongSelector extends Activity implements View.OnClickListener, OnIt
{
super.onCreate(icicle);
setContentView(R.layout.songselector);
setContentView(R.layout.song_selector);
mListView = (ListView)findViewById(R.id.song_list);
mAdapter = new SongAdapter(this);
mListView.setAdapter(mAdapter);