This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.util.Log; | |
import android.widget.Toast; | |
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.net.UnknownHostException; | |
import java.nio.ByteBuffer; | |
import java.nio.CharBuffer; | |
import java.nio.channels.SocketChannel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="midien.kheldiente.equalizer"> | |
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> | |
... Other android manifest stuff | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var mediaPlayer: MediaPlayer? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
... Other stuff to initalize | |
setupMediaPlayer() | |
startMediaPlayer() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var equalizer: Equalizer? = null | |
private fun initEqualizer() { | |
equalizer = Equalizer(0, mediaPlayer?.audioSessionId!!) | |
equalizer?.enabled = eqEnabled | |
} | |
private fun setupEqualizer() { | |
val numberOfBands = equalizer?.numberOfBands | |
val lowestBandLevel = equalizer?.bandLevelRange?.get(0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
object PixelUtil { | |
fun pxToDp(context: Context, px: Float): Float { | |
return px / context.resources.displayMetrics.density | |
} | |
fun dpToPx(context: Context, dp: Float): Float { | |
return dp * context.resources.displayMetrics.density |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.graphics.* | |
import android.util.AttributeSet | |
import android.util.Log | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.SeekBar | |
import kotlin.collections.ArrayList | |
import midien.kheldiente.equalizer.R | |
import midien.kheldiente.equalizer.util.PixelUtil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/colorPrimary" | |
android:orientation="vertical" | |
tools:context="midien.kheldiente.equalizer.MainActivity" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item | |
android:id="@android:id/background" | |
android:drawable="@android:color/transparent" > | |
</item> | |
<item | |
android:id="@android:id/progress" > | |
<clip | |
android:drawable="@drawable/seekbar_progress" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list | |
xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item | |
android:id="@+id/progressshape" > | |
<clip> | |
<shape | |
android:shape="rectangle" > | |
<size android:height="5dp"/> | |
<corners |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="oval"> | |
<solid android:color="@android:color/white"/> | |
<size | |
android:width="20dp" | |
android:height="20dp"/> | |
</shape> | |
</item> |
OlderNewer