Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lig-aikuma
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laurent Besacier
lig-aikuma
Commits
00cc5c41
Commit
00cc5c41
authored
Apr 26, 2017
by
mistermad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Add waveform visualization of the original audio file in the Elicitation and Traslating mode
parent
6e7e27b7
Changes
63
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
3923 additions
and
319 deletions
+3923
-319
Lig-Aikuma/app/build.gradle
Lig-Aikuma/app/build.gradle
+1
-0
Lig-Aikuma/app/lig-Aikuma.apk
Lig-Aikuma/app/lig-Aikuma.apk
+0
-0
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ModeSelection.java
...n/java/org/getalp/ligaikuma/lig_aikuma/ModeSelection.java
+60
-64
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/SimplePlayer.java
...a/org/getalp/ligaikuma/lig_aikuma/audio/SimplePlayer.java
+4
-2
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/record/Microphone.java
.../getalp/ligaikuma/lig_aikuma/audio/record/Microphone.java
+5
-7
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/record/Recorder.java
...rg/getalp/ligaikuma/lig_aikuma/audio/record/Recorder.java
+1
-4
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/record/ThumbRespeaker.java
...alp/ligaikuma/lig_aikuma/audio/record/ThumbRespeaker.java
+4
-6
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/model/Recording.java
...java/org/getalp/ligaikuma/lig_aikuma/model/Recording.java
+2
-2
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/CheckTranscription.java
...rg/getalp/ligaikuma/lig_aikuma/ui/CheckTranscription.java
+18
-21
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/CheckWordVariant.java
.../org/getalp/ligaikuma/lig_aikuma/ui/CheckWordVariant.java
+14
-15
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/CloudSearchActivity.java
...g/getalp/ligaikuma/lig_aikuma/ui/CloudSearchActivity.java
+15
-20
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/DebugInfo.java
...in/java/org/getalp/ligaikuma/lig_aikuma/ui/DebugInfo.java
+5
-6
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/ElicitationMode.java
...a/org/getalp/ligaikuma/lig_aikuma/ui/ElicitationMode.java
+1
-1
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/ListenActivity.java
...va/org/getalp/ligaikuma/lig_aikuma/ui/ListenActivity.java
+0
-1
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/ListenFragment.java
...va/org/getalp/ligaikuma/lig_aikuma/ui/ListenFragment.java
+1
-1
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/RecordElicitation.java
...org/getalp/ligaikuma/lig_aikuma/ui/RecordElicitation.java
+21
-24
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/RecordingMetadataLig.java
.../getalp/ligaikuma/lig_aikuma/ui/RecordingMetadataLig.java
+13
-14
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/RespeakingMetadataLig.java
...getalp/ligaikuma/lig_aikuma/ui/RespeakingMetadataLig.java
+20
-9
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/RespeakingSelection.java
...g/getalp/ligaikuma/lig_aikuma/ui/RespeakingSelection.java
+1
-2
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/SettingsActivity.java
.../org/getalp/ligaikuma/lig_aikuma/ui/SettingsActivity.java
+5
-9
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/ThumbRespeakActivityLig.java
...talp/ligaikuma/lig_aikuma/ui/ThumbRespeakActivityLig.java
+35
-37
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/ThumbRespeakFragment.java
.../getalp/ligaikuma/lig_aikuma/ui/ThumbRespeakFragment.java
+48
-21
Lig-Aikuma/app/src/main/res/drawable/drawable/type_folder_image.png
.../app/src/main/res/drawable/drawable/type_folder_image.png
+0
-0
Lig-Aikuma/app/src/main/res/drawable/drawable/type_folder_video.png
.../app/src/main/res/drawable/drawable/type_folder_video.png
+0
-0
Lig-Aikuma/app/src/main/res/drawable/type_folder_image.png
Lig-Aikuma/app/src/main/res/drawable/type_folder_image.png
+0
-0
Lig-Aikuma/app/src/main/res/drawable/type_folder_video.png
Lig-Aikuma/app/src/main/res/drawable/type_folder_video.png
+0
-0
Lig-Aikuma/app/src/main/res/layout-xlarge/thumb_respeak_fragment.xml
...app/src/main/res/layout-xlarge/thumb_respeak_fragment.xml
+14
-7
Lig-Aikuma/app/src/main/res/layout/record_activity_lig.xml
Lig-Aikuma/app/src/main/res/layout/record_activity_lig.xml
+2
-5
Lig-Aikuma/app/src/main/res/layout/session_dialog.xml
Lig-Aikuma/app/src/main/res/layout/session_dialog.xml
+12
-12
Lig-Aikuma/app/src/main/res/layout/thumb_respeak_fragment.xml
...Aikuma/app/src/main/res/layout/thumb_respeak_fragment.xml
+9
-1
Lig-Aikuma/app/src/main/res/values/strings.xml
Lig-Aikuma/app/src/main/res/values/strings.xml
+9
-27
Lig-Aikuma/library/.gitignore
Lig-Aikuma/library/.gitignore
+1
-0
Lig-Aikuma/library/build.gradle
Lig-Aikuma/library/build.gradle
+24
-0
Lig-Aikuma/library/proguard-rules.pro
Lig-Aikuma/library/proguard-rules.pro
+17
-0
Lig-Aikuma/library/src/androidTest/java/com/semantive/waveformandroid/ApplicationTest.java
...t/java/com/semantive/waveformandroid/ApplicationTest.java
+13
-0
Lig-Aikuma/library/src/main/AndroidManifest.xml
Lig-Aikuma/library/src/main/AndroidManifest.xml
+4
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/MediaPlayerFactory.java
...emantive/waveformandroid/waveform/MediaPlayerFactory.java
+23
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/Segment.java
.../java/com/semantive/waveformandroid/waveform/Segment.java
+25
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/WaveformFragment.java
.../semantive/waveformandroid/waveform/WaveformFragment.java
+496
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/WaveformView.java
.../com/semantive/waveformandroid/waveform/WaveformView.java
+518
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapAAC.java
...emantive/waveformandroid/waveform/soundfile/CheapAAC.java
+469
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapAMR.java
...emantive/waveformandroid/waveform/soundfile/CheapAMR.java
+973
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapMP3.java
...emantive/waveformandroid/waveform/soundfile/CheapMP3.java
+258
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapSoundFile.java
...ve/waveformandroid/waveform/soundfile/CheapSoundFile.java
+194
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapWAV.java
...emantive/waveformandroid/waveform/soundfile/CheapWAV.java
+125
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/WavFile.java
...semantive/waveformandroid/waveform/soundfile/WavFile.java
+307
-0
Lig-Aikuma/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/WavFileException.java
.../waveformandroid/waveform/soundfile/WavFileException.java
+11
-0
Lig-Aikuma/library/src/main/res/drawable/marker_left.xml
Lig-Aikuma/library/src/main/res/drawable/marker_left.xml
+24
-0
Lig-Aikuma/library/src/main/res/drawable/marker_left_focused.png
...uma/library/src/main/res/drawable/marker_left_focused.png
+0
-0
Lig-Aikuma/library/src/main/res/drawable/marker_left_normal.png
...kuma/library/src/main/res/drawable/marker_left_normal.png
+0
-0
Lig-Aikuma/library/src/main/res/drawable/marker_left_pressed.png
...uma/library/src/main/res/drawable/marker_left_pressed.png
+0
-0
Lig-Aikuma/library/src/main/res/drawable/marker_right.xml
Lig-Aikuma/library/src/main/res/drawable/marker_right.xml
+24
-0
Lig-Aikuma/library/src/main/res/drawable/marker_right_focused.png
...ma/library/src/main/res/drawable/marker_right_focused.png
+0
-0
Lig-Aikuma/library/src/main/res/drawable/marker_right_normal.png
...uma/library/src/main/res/drawable/marker_right_normal.png
+0
-0
Lig-Aikuma/library/src/main/res/drawable/marker_right_pressed.png
...ma/library/src/main/res/drawable/marker_right_pressed.png
+0
-0
Lig-Aikuma/library/src/main/res/layout/fragment_waveform.xml
Lig-Aikuma/library/src/main/res/layout/fragment_waveform.xml
+14
-0
Lig-Aikuma/library/src/main/res/values/colors.xml
Lig-Aikuma/library/src/main/res/values/colors.xml
+11
-0
Lig-Aikuma/library/src/main/res/values/dimens.xml
Lig-Aikuma/library/src/main/res/values/dimens.xml
+5
-0
Lig-Aikuma/library/src/main/res/values/strings_waveform.xml
Lig-Aikuma/library/src/main/res/values/strings_waveform.xml
+14
-0
Lig-Aikuma/library/src/main/res/values/styles.xml
Lig-Aikuma/library/src/main/res/values/styles.xml
+8
-0
Lig-Aikuma/library/src/main/res/values/styles_waveform.xml
Lig-Aikuma/library/src/main/res/values/styles_waveform.xml
+29
-0
Lig-Aikuma/library/src/test/java/com/semantive/waveformandroid/ExampleUnitTest.java
...t/java/com/semantive/waveformandroid/ExampleUnitTest.java
+15
-0
Lig-Aikuma/settings.gradle
Lig-Aikuma/settings.gradle
+1
-1
No files found.
Lig-Aikuma/app/build.gradle
View file @
00cc5c41
...
...
@@ -53,4 +53,5 @@ dependencies {
compile
'com.android.support:multidex:1.0.1'
testCompile
'junit:junit:4.12'
compile
'javax.annotation:javax.annotation-api:1.2'
compile
project
(
path:
':library'
)
}
Lig-Aikuma/app/lig-Aikuma.apk
View file @
00cc5c41
No preview for this file type
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ModeSelection.java
View file @
00cc5c41
...
...
@@ -53,30 +53,31 @@ public class ModeSelection extends Activity implements OnClickListener{
/** Called when the activity is first created. */
@Override
@SuppressLint
(
"CommitPrefEdits"
)
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
mode_selection
);
// set owner id with gmail account first but replaced with a random id now
SharedPreferences
settings
=
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
mode_selection
);
// set owner id with gmail account first but replaced with a random id now
SharedPreferences
settings
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
);
//AikumaSettings.setUserId(settings.getString(AikumaSettings.SETTING_OWNER_ID_KEY, null));
if
(
AikumaSettings
.
getCurrentUserId
()
==
null
)
{
Random
r
=
new
Random
();
AikumaSettings
.
setUserId
(
Integer
.
toString
(
r
.
nextInt
()));
//AikumaSettings.setUserId(settings.getString(AikumaSettings.SETTING_OWNER_ID_KEY, null));
if
(
AikumaSettings
.
getCurrentUserId
()
==
null
)
{
Random
r
=
new
Random
();
AikumaSettings
.
setUserId
(
Integer
.
toString
(
r
.
nextInt
()));
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
AikumaSettings
.
getCurrentUserId
());
}
// DEBUG
Map
<
String
,?>
mapPrefs
=
settings
.
getAll
();
for
(
String
key
:
mapPrefs
.
keySet
())
}
// DEBUG
Map
<
String
,?>
mapPrefs
=
settings
.
getAll
();
for
(
String
key
:
mapPrefs
.
keySet
())
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"DEBUG - Shared Preferences - "
+
key
+
" -> "
+
mapPrefs
.
get
(
key
));
// hides the action bar instead of removing it
// hides the action bar instead of removing it
// getActionBar().hide();
Aikuma
.
loadLanguages
(
this
.
getApplicationContext
());
Button
btn_rec
=
(
Button
)
findViewById
(
R
.
id
.
button_mode_record
);
btn_rec
.
setOnClickListener
(
this
);
Button
btn_respk
=
(
Button
)
findViewById
(
R
.
id
.
button_mode_respeak
);
...
...
@@ -89,15 +90,15 @@ public class ModeSelection extends Activity implements OnClickListener{
btn_check
.
setOnClickListener
(
this
);
// Button btn_old_aikuma = (Button) findViewById(R.id.button_mode_slct_old_aikuma);
// btn_old_aikuma.setOnClickListener(this);
// Start gathering location data
MainActivity
.
locationDetector
=
new
LocationDetector
(
this
);
// check the existing session and show popup to propose retrieving it
prefsUserSession
=
getSharedPreferences
(
getString
(
R
.
string
.
userSession
)
,
MODE_PRIVATE
);
ed
=
prefsUserSession
.
edit
();
if
(
prefsUserSession
.
getBoolean
(
getString
(
R
.
string
.
sessionActive
)
,
false
))
showSessionDialog
();
// check the existing session and show popup to propose retrieving it
prefsUserSession
=
getSharedPreferences
(
"userSession"
,
MODE_PRIVATE
);
ed
=
prefsUserSession
.
edit
();
if
(
prefsUserSession
.
getBoolean
(
"active"
,
false
))
showSessionDialog
();
}
@Override
...
...
@@ -105,7 +106,7 @@ public class ModeSelection extends Activity implements OnClickListener{
switch
(
v
.
getId
())
{
// DONE add a button for respeaking and link to the corresponding activity
// DONE create a selection view with 2 buttons: one for recording and one for importing audio
// DONE link the "recording" button to existing recording structure
// DONE link the "recording" button to existing recording structure
// (link to recordingMetadataLig activity and allow RecordActivityLig to link to Respeaking)
// DONE study how resepaking is done and reuse it (only the respeaking view and its process)
// (in particular, beware to check the storage location of the respeaking and mapping files)
...
...
@@ -189,10 +190,9 @@ public class ModeSelection extends Activity implements OnClickListener{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"no don't retrieve the session but keep files"
);
prefsUserSession
=
getSharedPreferences
(
getString
(
R
.
string
.
userSession
)
,
MODE_PRIVATE
);
prefsUserSession
=
getSharedPreferences
(
"userSession"
,
MODE_PRIVATE
);
//clear sharedPrefs
ed
.
clear
();
ed
.
commit
();
ed
.
clear
().
commit
();
}
})
.
setNeutralButton
(
R
.
string
.
no_and_erase_files
,
new
DialogInterface
.
OnClickListener
()
{
...
...
@@ -203,31 +203,27 @@ public class ModeSelection extends Activity implements OnClickListener{
//remove files
eraseFiles
();
//clear sharedPrefs
ed
.
clear
();
// ed.putBoolean(getString(R.string.sessionActive), false);
ed
.
commit
();
ed
.
c
lear
().
c
ommit
();
}
});
return
builder
.
create
();
}
public
void
retrieveSession
()
{
String
mode
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionMode
)
,
null
);
String
mode
=
prefsUserSession
.
getString
(
"mode"
,
null
);
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"mode retrieval: "
+
mode
);
Intent
intent
;
if
(
mode
.
compareToIgnoreCase
(
CheckTranscription
.
TAG
)
==
0
)
{
intent
=
new
Intent
(
getActivity
(),
CheckTranscription
.
class
);
}
else
if
(
mode
.
compareToIgnoreCase
(
CheckWordVariant
.
TAG
)
==
0
)
{
intent
=
new
Intent
(
getActivity
(),
CheckWordVariant
.
class
);
}
else
if
(
mode
.
compareToIgnoreCase
(
ThumbRespeakActivityLig
.
TAG
)
==
0
)
{
intent
=
new
Intent
(
getActivity
(),
ThumbRespeakActivityLig
.
class
);
}
else
if
(
mode
.
compareToIgnoreCase
(
RecordElicitation
.
TAG
)
==
0
)
{
intent
=
new
Intent
(
getActivity
(),
RecordElicitation
.
class
);
}
else
{
if
(((
mode
!=
null
)?
mode
.
compareToIgnoreCase
(
CheckTranscription
.
TAG
):
0
)
==
0
)
startActivity
(
new
Intent
(
getActivity
(),
CheckTranscription
.
class
));
else
if
(
mode
.
compareToIgnoreCase
(
CheckWordVariant
.
TAG
)
==
0
)
startActivity
(
new
Intent
(
getActivity
(),
CheckWordVariant
.
class
));
else
if
(
mode
.
compareToIgnoreCase
(
ThumbRespeakActivityLig
.
TAG
)
==
0
)
startActivity
(
new
Intent
(
getActivity
(),
ThumbRespeakActivityLig
.
class
));
else
if
(
mode
.
compareToIgnoreCase
(
RecordElicitation
.
TAG
)
==
0
)
startActivity
(
new
Intent
(
getActivity
(),
RecordElicitation
.
class
));
else
Toast
.
makeText
(
getActivity
(),
"An error ocurred. The session could not be retrieved"
,
Toast
.
LENGTH_LONG
).
show
();
return
;
}
startActivity
(
intent
);
}
public
void
setDialogDetails
(
LinearLayout
ll
)
{
...
...
@@ -244,20 +240,20 @@ public class ModeSelection extends Activity implements OnClickListener{
* ThumbRespeakActivityLig / respeaking ----------> Respeaking / null
* "" / translation ----------> Translation / null
*/
String
mode
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionMode
),
getString
(
R
.
string
.
undefined
)
);
String
submode
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
session_submode
),
getString
(
R
.
string
.
undefined
)
);
String
mode
=
prefsUserSession
.
getString
(
"mode"
,
"undefined"
);
String
submode
=
prefsUserSession
.
getString
(
"submode"
,
"undefined"
);
String
modeDialog
=
null
,
submodeDialog
=
null
;
if
(
mode
.
compareToIgnoreCase
(
CheckWordVariant
.
TAG
)
==
0
||
mode
.
compareTo
(
CheckTranscription
.
TAG
)
==
0
)
{
modeDialog
=
getString
(
R
.
string
.
check_mode
);
submodeDialog
=
(
mode
.
compareToIgnoreCase
(
CheckWordVariant
.
TAG
)
==
0
)
?
CheckWordVariant
.
TAG
:
CheckTranscription
.
TAG
;
}
else
if
(
mode
.
compareToIgnoreCase
(
RecordElicitation
.
TAG
)
==
0
)
{
modeDialog
=
getString
(
R
.
string
.
elicitation
);
if
(
submode
.
compareToIgnoreCase
(
"text"
)
==
0
)
{
submodeDialog
=
"text"
;
}
else
if
(
submode
.
compareToIgnoreCase
(
"image"
)
==
0
)
{
submodeDialog
=
"image"
;
}
else
if
(
submode
.
compareToIgnoreCase
(
"video"
)
==
0
)
{
submodeDialog
=
"video"
;
}
if
(
submode
.
compareToIgnoreCase
(
"text"
)
==
0
)
submodeDialog
=
"text"
;
else
if
(
submode
.
compareToIgnoreCase
(
"image"
)
==
0
)
submodeDialog
=
"image"
;
else
if
(
submode
.
compareToIgnoreCase
(
"video"
)
==
0
)
submodeDialog
=
"video"
;
}
else
if
(
mode
.
compareToIgnoreCase
(
ThumbRespeakActivityLig
.
TAG
)
==
0
)
{
if
(
submode
.
compareToIgnoreCase
(
getString
(
R
.
string
.
respeak
))
==
0
)
{
modeDialog
=
"Respeaking"
;
}
else
if
(
submode
.
compareToIgnoreCase
(
getString
(
R
.
string
.
translation
))
==
0
)
{
modeDialog
=
"Translation"
;
}
if
(
submode
.
compareToIgnoreCase
(
getString
(
R
.
string
.
respeak
))
==
0
)
modeDialog
=
"Respeaking"
;
else
if
(
submode
.
compareToIgnoreCase
(
getString
(
R
.
string
.
translation
))
==
0
)
modeDialog
=
"Translation"
;
submodeDialog
=
"None"
;
}
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_mode
)).
setText
(
modeDialog
);
...
...
@@ -265,32 +261,32 @@ public class ModeSelection extends Activity implements OnClickListener{
// display date in a more convenient way
try
{
Date
date
=
new
SimpleDateFormat
().
parse
(
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionDate
)
,
"undefined"
));
Date
date
=
new
SimpleDateFormat
().
parse
(
prefsUserSession
.
getString
(
"date"
,
"undefined"
));
// TODO parsing fails...
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_date
)).
setText
(
new
SimpleDateFormat
(
"dd/MM/yyyy at HH:mm"
,
Locale
.
FRANCE
).
format
(
date
));
}
catch
(
ParseException
e
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
e
(
TAG
,
""
+
e
);
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_date
)).
setText
(
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionDate
)
,
"undefined"
));
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_date
)).
setText
(
prefsUserSession
.
getString
(
"date"
,
"undefined"
));
}
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_progress
)).
setText
(
""
+
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionProgress
)
,
"0"
));
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_progress
)).
setText
(
""
+
prefsUserSession
.
getString
(
"progress"
,
"0"
));
// display only filename
String
file
=
new
File
(
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionInputFile
)
,
"undefined"
)).
getName
();
String
file
=
new
File
(
prefsUserSession
.
getString
(
"inputFile"
,
"undefined"
)).
getName
();
((
TextView
)
ll
.
findViewById
(
R
.
id
.
session_input_file
)).
setText
(
file
);
}
}
public
void
eraseFiles
()
{
File
savedFile
;
String
savedMode
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionMode
)
,
null
);
String
savedSubmode
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
session_submode
)
,
"undefined"
);
String
savedMode
=
prefsUserSession
.
getString
(
"mode"
,
null
);
String
savedSubmode
=
prefsUserSession
.
getString
(
"submode"
,
"undefined"
);
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"saved mode: "
+
savedMode
);
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"saved submode: "
+
savedSubmode
);
/*Check Mode*/
if
(
savedMode
.
compareToIgnoreCase
(
CheckWordVariant
.
TAG
)
==
0
||
savedMode
.
compareTo
(
CheckTranscription
.
TAG
)
==
0
)
{
savedFile
=
new
File
(
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionCheckExportFile
)
,
"undefined"
));
savedFile
=
new
File
(
prefsUserSession
.
getString
(
"checkExportFile"
,
"undefined"
));
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"saved file: "
+
savedFile
);
savedFile
.
delete
();
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"saved file erased: "
+
savedFile
);
...
...
@@ -299,9 +295,9 @@ public class ModeSelection extends Activity implements OnClickListener{
}
else
if
(
savedMode
.
compareToIgnoreCase
(
RecordElicitation
.
TAG
)
==
0
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"saved submode: "
+
savedSubmode
);
String
idDevice
=
Aikuma
.
getDeviceId
();
String
savedDate
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionDate
)
,
""
);
Language
savedRecordLang
=
new
Language
(
prefsUserSession
.
getString
(
getString
(
R
.
string
.
language_name
),
""
),
prefsUserSession
.
getString
(
getString
(
R
.
string
.
languageCode
)
,
""
));
String
savedDate
=
prefsUserSession
.
getString
(
"date"
,
""
);
Language
savedRecordLang
=
new
Language
(
prefsUserSession
.
getString
(
"Language name"
,
""
),
prefsUserSession
.
getString
(
"LanguageCode"
,
""
));
String
name
=
savedDate
+
"_"
+
savedRecordLang
.
getCode
()
+
"_"
+
idDevice
;
//erase linker
...
...
@@ -310,7 +306,7 @@ public class ModeSelection extends Activity implements OnClickListener{
savedTextFile
.
delete
();
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"saved file erased: "
+
savedTextFile
);
//erase metadata and audio files
int
savedProgress
=
prefsUserSession
.
getInt
(
getString
(
R
.
string
.
currentLine
)
,
0
);
int
savedProgress
=
prefsUserSession
.
getInt
(
"currentLine"
,
0
);
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"saved progress: "
+
savedProgress
);
for
(
int
i
=
savedProgress
;
i
>=
0
;
i
--)
{
File
savedMetadataFile
=
new
File
(
FileIO
.
getOwnerPath
()+
"/recordings/"
+
name
+
"/"
+
name
+
"_"
+
i
+
RecordingLig
.
METADATA_SUFFIX
);
...
...
@@ -347,7 +343,7 @@ public class ModeSelection extends Activity implements OnClickListener{
// }
//}
Toast
.
makeText
(
this
,
"Session and files erased."
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
this
,
R
.
string
.
session_and_files_erased
,
Toast
.
LENGTH_LONG
).
show
();
}
}
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/SimplePlayer.java
View file @
00cc5c41
...
...
@@ -8,6 +8,8 @@ import android.media.AudioManager;
import
android.media.MediaPlayer
;
import
android.util.Log
;
import
com.semantive.waveformandroid.waveform.MediaPlayerFactory
;
import
org.getalp.ligaikuma.lig_aikuma.lig_aikuma.BuildConfig
;
import
org.getalp.ligaikuma.lig_aikuma.model.Recording
;
...
...
@@ -39,7 +41,7 @@ public class SimplePlayer extends Player implements Sampler
*/
public
SimplePlayer
(
Recording
recording
,
boolean
playThroughSpeaker
)
throws
IOException
{
setRecording
(
recording
);
mediaPlayer
=
new
MediaPlayer
();
mediaPlayer
=
MediaPlayerFactory
.
getNew
MediaPlayer
();
mediaPlayer
.
setAudioStreamType
((
playThroughSpeaker
)?
AudioManager
.
STREAM_MUSIC
:
AudioManager
.
STREAM_VOICE_CALL
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
"SimplePlayer"
,
"Media Player - data source: "
+
recording
.
getFile
().
getCanonicalPath
());
mediaPlayer
.
setDataSource
(
recording
.
getFile
().
getCanonicalPath
());
...
...
@@ -190,7 +192,7 @@ public class SimplePlayer extends Player implements Sampler
//Never use
//protected void setFinishedPlaying(boolean finished) {this.finishedPlaying = finished;}
p
rotected
Recording
getRecording
()
{
p
ublic
Recording
getRecording
()
{
return
recording
;
}
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/record/Microphone.java
View file @
00cc5c41
...
...
@@ -151,17 +151,15 @@ public class Microphone {
private
static
AudioRecord
getListener
(
int
sampleRate
,
int
audioFormat
,
int
channelConfig
)
{
// Sample size.
int
sampleSize
=
(
audioFormat
==
AudioFormat
.
ENCODING_PCM_16BIT
)?
16
:
8
;
// Channels.
int
numberOfChannels
=
(
channelConfig
==
AudioFormat
.
CHANNEL_IN_MONO
)?
1
:
2
;
// Sample size and Channels.
int
sampleSize
=
(
audioFormat
==
AudioFormat
.
ENCODING_PCM_16BIT
)?
16
:
8
,
numberOfChannels
=
(
channelConfig
==
AudioFormat
.
CHANNEL_IN_MONO
)?
1
:
2
,
// Calculate buffer size.
/** The period used for callbacks to onBufferFull. */
int
framePeriod
=
sampleRate
*
120
/
1000
;
framePeriod
=
sampleRate
*
120
/
1000
,
/** The buffer needed for the above period */
int
bufferSize
=
framePeriod
*
2
*
sampleSize
*
numberOfChannels
/
8
;
bufferSize
=
framePeriod
*
2
*
sampleSize
*
numberOfChannels
/
8
;
return
new
AudioRecord
(
MediaRecorder
.
AudioSource
.
MIC
,
sampleRate
,
AudioFormat
.
CHANNEL_IN_MONO
,
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/record/Recorder.java
View file @
00cc5c41
...
...
@@ -274,8 +274,7 @@ public class Recorder implements AudioHandler, MicrophoneListener, Sampler {
// Append all audio-values in srcBuffer to audioBuffer
private
void
storeBuffer
(
short
[]
srcBuffer
)
{
if
(
audioBuffer
.
length
<
audioBufLength
+
srcBuffer
.
length
)
{
int
newBufLength
=
2
*
audioBuffer
.
length
;
short
[]
newBuffer
=
new
short
[
newBufLength
];
short
[]
newBuffer
=
new
short
[(
2
*
audioBuffer
.
length
)];
System
.
arraycopy
(
audioBuffer
,
0
,
newBuffer
,
0
,
audioBufLength
);
audioBuffer
=
newBuffer
;
}
...
...
@@ -303,9 +302,7 @@ public class Recorder implements AudioHandler, MicrophoneListener, Sampler {
totalAudioLength
+=
buffer
.
length
;
if
(
this
.
type
==
0
&&
Math
.
round
((
double
)
totalAudioLength
/
sampleRate
)
<
Recording
.
SAMPLE_SEC
)
// 15sec sample
{
sampleFile
.
write
(
buffer
);
}
}
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/audio/record/ThumbRespeaker.java
View file @
00cc5c41
...
...
@@ -41,8 +41,7 @@ public class ThumbRespeaker {
public
ThumbRespeaker
(
Recording
original
,
UUID
respeakingUUID
,
int
rewindAmount
)
throws
Microphone
.
MicException
,
IOException
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
"Rte-ThumbRespeaker"
,
"smp : "
+
original
.
getSampleRate
());
recorder
=
new
Recorder
(
1
,
new
File
(
Recording
.
getNoSyncRecordingsPath
(),
respeakingUUID
+
".wav"
),
original
.
getSampleRate
());
recorder
=
new
Recorder
(
1
,
new
File
(
Recording
.
getNoSyncRecordingsPath
(),
respeakingUUID
+
".wav"
),
original
.
getSampleRate
());
player
=
new
SimplePlayer
(
original
,
true
);
mapper
=
new
Mapper
(
respeakingUUID
);
setFinishedPlaying
(
false
);
...
...
@@ -60,10 +59,9 @@ public class ThumbRespeaker {
* @throws MicException If the microphone couldn't be used.
* @throws IOException If there is an I/O issue.
*/
public
ThumbRespeaker
(
RecordingLig
original
,
UUID
respeakingUUID
,
int
rewindAmount
)
throws
MicException
,
IOException
{
recorder
=
new
Recorder
(
1
,
new
File
(
Recording
.
getNoSyncRecordingsPath
(),
respeakingUUID
+
".wav"
),
original
.
getSampleRate
());
public
ThumbRespeaker
(
RecordingLig
original
,
UUID
respeakingUUID
,
int
rewindAmount
)
throws
MicException
,
IOException
{
recorder
=
new
Recorder
(
1
,
new
File
(
Recording
.
getNoSyncRecordingsPath
(),
respeakingUUID
+
".wav"
),
original
.
getSampleRate
());
player
=
new
SimplePlayer
(
original
,
true
);
mapper
=
new
Mapper
(
respeakingUUID
);
setFinishedPlaying
(
false
);
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/model/Recording.java
View file @
00cc5c41
...
...
@@ -1410,8 +1410,8 @@ public class Recording extends FileModel {
*/
/*
public static void enableSync(String id) throws IOException {
File
w
avFile = new File(getNoSyncRecordingsPath(), uuid + ".wav");
FileUtils.moveFileToDirectory(
w
avFile, getRecordingsPath(), false);
File
W
avFile = new File(getNoSyncRecordingsPath(), uuid + ".wav");
FileUtils.moveFileToDirectory(
W
avFile, getRecordingsPath(), false);
}
*/
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/CheckTranscription.java
View file @
00cc5c41
...
...
@@ -66,33 +66,31 @@ public class CheckTranscription extends AikumaActivity {
initProgressBars
();
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
"dataPath"
,
dataPath
);
prefsUserSession
=
getSharedPreferences
(
getString
(
R
.
string
.
userSession
)
,
MODE_PRIVATE
);
prefsUserSession
=
getSharedPreferences
(
"userSession"
,
MODE_PRIVATE
);
date
=
new
SimpleDateFormat
(
"yyyyMMdd-HHmmss"
,
Locale
.
FRANCE
).
format
(
new
Date
());
//case: session already exists
boolean
append
;
if
(
prefsUserSession
.
getBoolean
(
getString
(
R
.
string
.
sessionActive
)
,
false
))
{
if
(
prefsUserSession
.
getBoolean
(
"active"
,
false
))
{
//retrieve selected file handled in the last session
transcripTextFile
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionInputFile
)
,
null
);
transcripTextFile
=
prefsUserSession
.
getString
(
"inputFile"
,
null
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Selected import file: "
+
transcripTextFile
);
//retrieve result file handled in the last session
transcriptChecked
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionCheckExportFile
)
,
null
);
transcriptChecked
=
prefsUserSession
.
getString
(
"checkExportFile"
,
null
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Selected export file: "
+
transcriptChecked
);
//retrieve number of lines already handled in the last session
//nbReadLines = Integer.parseInt(prefsUserSession.getString(getString(R.string.sessionProgress),"0"));
nbReadLines
=
prefsUserSession
.
getInt
(
getString
(
R
.
string
.
currentLine
)
,
0
);
nbReadLines
=
prefsUserSession
.
getInt
(
"currentLine"
,
0
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"onCreate - #sentences treated: "
+
nbReadLines
);
append
=
true
;
// clear the current stored session
SharedPreferences
.
Editor
ed
=
prefsUserSession
.
edit
();
ed
.
clear
();
ed
.
commit
();
prefsUserSession
.
edit
().
clear
().
apply
();
isNewSession
=
false
;
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Is it a new session ? "
+
isNewSession
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Is it a new session ? "
+
false
);
//case: no session
}
else
{
transcripTextFile
=
getIntent
().
getStringExtra
(
CheckMode
.
importFileName
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Is it a new session ? "
+
isNewSession
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Selected file: "
+
transcripTextFile
);
if
(
BuildConfig
.
DEBUG
)
{
Log
.
i
(
TAG
,
"Is it a new session ? "
+
isNewSession
);
Log
.
i
(
TAG
,
"Selected file: "
+
transcripTextFile
);}
append
=
false
;
//output filename
transcriptChecked
=
transcripTextFile
.
replace
(
".txt"
,
"_"
+
date
+
"_CHECKED.txt"
);
...
...
@@ -307,13 +305,13 @@ public class CheckTranscription extends AikumaActivity {
*/
date
=
new
SimpleDateFormat
(
"yyyyMMdd-HHmmss"
,
Locale
.
FRANCE
).
format
(
new
Date
());
SharedPreferences
.
Editor
ed
=
prefsUserSession
.
edit
();
ed
.
putBoolean
(
getString
(
R
.
string
.
sessionActive
)
,
true
);
//session activated
ed
.
putInt
(
getString
(
R
.
string
.
currentLine
)
,
nbReadLines
);
//nb lines
ed
.
putString
(
getString
(
R
.
string
.
sessionProgress
)
,
nbReadLines
+
" / "
+
nb_total_lines
);
ed
.
putString
(
getString
(
R
.
string
.
sessionInputFile
)
,
transcripTextFile
);
//handled file
ed
.
putString
(
getString
(
R
.
string
.
sessionCheckExportFile
)
,
transcriptChecked
);
//resulting file
ed
.
putString
(
getString
(
R
.
string
.
sessionDate
)
,
date
);
//set date
ed
.
putString
(
getString
(
R
.
string
.
sessionMode
)
,
TAG
);
//set mode
ed
.
putBoolean
(
"active"
,
true
);
//session activated
ed
.
putInt
(
"currentLine"
,
nbReadLines
);
//nb lines
ed
.
putString
(
"progress"
,
nbReadLines
+
" / "
+
nb_total_lines
);
ed
.
putString
(
"inputFile"
,
transcripTextFile
);
//handled file
ed
.
putString
(
"checkExportFile"
,
transcriptChecked
);
//resulting file
ed
.
putString
(
"date"
,
date
);
//set date
ed
.
putString
(
"mode"
,
TAG
);
//set mode
// ed.putBoolean(getString(R.string.checkTranscript), true); //set submode
//save infos
ed
.
commit
();
...
...
@@ -354,13 +352,12 @@ public class CheckTranscription extends AikumaActivity {
try
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
"saveFile"
,
"Writing on file"
);
//if checked
if
(
transcriptOK
.
isChecked
())
{
if
(
transcriptOK
.
isChecked
())
outputFile
.
write
(
transcriptID
.
getText
()+
" : "
+
transcriptOK
.
getText
()+
"\n"
);
}
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();}
return
true
;
}
private
void
interruptionCallback
()
{
if
(
nbReadLines
==
0
)
{
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/CheckWordVariant.java
View file @
00cc5c41
...
...
@@ -53,9 +53,9 @@ public class CheckWordVariant extends AikumaActivity {
setContentView
(
R
.
layout
.
check_word_variant
);
initProgressBars
();
date
=
new
SimpleDateFormat
(
"yyyyMMdd-HHmmss"
,
Locale
.
FRANCE
).
format
(
new
Date
());
prefsUserSession
=
getSharedPreferences
(
getString
(
R
.
string
.
userSession
)
,
MODE_PRIVATE
);
prefsUserSession
=
getSharedPreferences
(
"userSession"
,
MODE_PRIVATE
);
//case: session already exists
if
(
prefsUserSession
.
getBoolean
(
getString
(
R
.
string
.
sessionActive
)
,
false
))
{
if
(
prefsUserSession
.
getBoolean
(
"active"
,
false
))
{
/*
* TODO rajouter une condition en &&
* soustraire date.now à date session :
...
...
@@ -63,18 +63,17 @@ public class CheckWordVariant extends AikumaActivity {
* sinon continue;
*/
//retrieve selected file handled in the last session
variantTextFile
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionInputFile
),
null
);
variantTextFile
=
prefsUserSession
.
getString
(
"inputFile"
,
null
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Selected import file: "
+
variantTextFile
);
//retrieve result file handled in the last session
variantchecked
=
prefsUserSession
.
getString
(
getString
(
R
.
string
.
sessionCheckExportFile
)
,
null
);
variantchecked
=
prefsUserSession
.
getString
(
"checkExportFile"
,
null
);
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"Selected export file: "
+
variantchecked
);
//retrieve number of lines already handled in the last session
nbReadLines
=
prefsUserSession
.
getInt
(
getString
(
R
.
string
.
nbReadLines
)
,
0
);
nbReadLines
=
prefsUserSession
.
getInt
(
"nbReadLine"
,
0
);
append
=
true
;
// clear the current stored session
SharedPreferences
.
Editor
ed
=
prefsUserSession
.
edit
();
ed
.
clear
();
ed
.
commit
();
prefsUserSession
.
edit
().
clear
().
apply
();
//case: no session
}
else
{
variantTextFile
=
getIntent
().
getStringExtra
(
CheckMode
.
importFileName
);
...
...
@@ -304,16 +303,16 @@ public class CheckWordVariant extends AikumaActivity {
Toast
.
makeText
(
this
,
R
.
string
.
the_session_has_been_saved
,
Toast
.
LENGTH_SHORT
).
show
();
date
=
new
SimpleDateFormat
(
"yyyyMMdd-HHmmss"
,
Locale
.
FRANCE
).
format
(
new
Date
());
SharedPreferences
.
Editor
ed
=
prefsUserSession
.
edit
();
ed
.
putBoolean
(
getString
(
R
.
string
.
sessionActive
)
,
true
);
//session activated
ed
.
putInt
(
getString
(
R
.
string
.
nbReadLines
)
,
nbReadLines
);
//nb lines
ed
.
putString
(
getString
(
R
.
string
.
sessionProgress
)
,
nbReadLines
+
"/"
+
totalNumberOfExpressions
);
ed
.
putString
(
getString
(
R
.
string
.
sessionInputFile
)
,
variantTextFile
);
//handled file
ed
.
putString
(
getString
(
R
.
string
.
sessionCheckExportFile
)
,
variantchecked
);
//resulting file
ed
.
putString
(
getString
(
R
.
string
.
sessionDate
)
,
date
);
//set date
ed
.
putString
(
getString
(
R
.
string
.
sessionMode
)
,
TAG
);
//set mode
ed
.
putBoolean
(
"active"
,
true
);
//session activated
ed
.
putInt
(
"nbReadLine"
,
nbReadLines
);
//nb lines
ed
.
putString
(
"progress"
,
nbReadLines
+
"/"
+
totalNumberOfExpressions
);
ed
.
putString
(
"inputFile"
,
variantTextFile
);
//handled file
ed
.
putString
(
"checkExportFile"
,
variantchecked
);
//resulting file
ed
.
putString
(
"date"
,
date
);
//set date
ed
.
putString
(
"mode"
,
TAG
);
//set mode
// ed.putBoolean(getString(R.string.checkVariant), true); //set submode
//save infos
ed
.
commit
();
ed
.
apply
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
Lig-Aikuma/app/src/main/java/org/getalp/ligaikuma/lig_aikuma/ui/CloudSearchActivity.java
View file @
00cc5c41
...
...
@@ -91,8 +91,8 @@ public class CloudSearchActivity extends AikumaListActivity {
isMediaPlayerPrepared
=
false
;
setUpQuickMenu
();
recordings
=
new
ArrayList
<
Recording
>();
itemIdsToDownload
=
new
ArrayList
<
String
>();
recordings
=
new
ArrayList
<>();
itemIdsToDownload
=
new
ArrayList
<>();
adapter
=
new
RecordingArrayAdapter
(
this
,
recordings
,
quickMenu
);
setListAdapter
(
adapter
);
...
...
@@ -176,7 +176,7 @@ public class CloudSearchActivity extends AikumaListActivity {
// Creates the quickMenu for the original recording
//(quickMenu: download)
private
void
setUpQuickMenu
()
{
quickMenu
=
new
QuickActionMenu
<
Recording
>(
this
);
quickMenu
=
new
QuickActionMenu
<>(
this
);
if
(
AikumaSettings
.
getCurrentUserToken
()
!=
null
)
{
QuickActionItem
sampleDownloadAct
=
new
QuickActionItem
(
"Sample"
,
R
.
drawable
.
download_32
);
...
...
@@ -224,7 +224,7 @@ public class CloudSearchActivity extends AikumaListActivity {
String
sampleCloudId
=
new
FileModel
(
recording
.
getVersionName
(),
recording
.
getOwnerId
(),
recording
.
getPreviewId
(),
"preview"
,
"wav"
).
getCloudIdentifier
(
0
);
List
<
String
>
cloudId
=
new
ArrayList
<
String
>();
List
<
String
>
cloudId
=
new
ArrayList
<>();
cloudId
.
add
(
sampleCloudId
);
new
RequestShareFileTask
(
cloudId
,
googleEmailAccount
,
googleAuthToken
).
execute
();