Search in sources :

Example 11 with SavingTrackHelper

use of net.osmand.plus.track.helpers.SavingTrackHelper in project Osmand by osmandapp.

the class AudioVideoNotesPlugin method indexFile.

private void indexFile(boolean registerInGPX, File f) {
    if (f.getName().endsWith(THREEGP_EXTENSION) || f.getName().endsWith(MPEG4_EXTENSION) || f.getName().endsWith(IMG_EXTENSION)) {
        boolean newFileIndexed = indexSingleFile(f);
        if (newFileIndexed && registerInGPX) {
            Recording rec = recordingByFileName.get(f.getName());
            if (rec != null && (app.getSettings().SAVE_TRACK_TO_GPX.get() || app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()) && OsmandPlugin.isActive(OsmandMonitoringPlugin.class)) {
                String name = f.getName();
                SavingTrackHelper savingTrackHelper = app.getSavingTrackHelper();
                savingTrackHelper.insertPointData(rec.lat, rec.lon, System.currentTimeMillis(), null, name, null, 0);
            }
        }
    }
}
Also used : SavingTrackHelper(net.osmand.plus.track.helpers.SavingTrackHelper) OsmandMonitoringPlugin(net.osmand.plus.plugins.monitoring.OsmandMonitoringPlugin)

Aggregations

SavingTrackHelper (net.osmand.plus.track.helpers.SavingTrackHelper)11 GPXFile (net.osmand.GPXUtilities.GPXFile)6 WptPt (net.osmand.GPXUtilities.WptPt)4 View (android.view.View)3 ImageView (android.widget.ImageView)3 GpxSelectionHelper (net.osmand.plus.track.helpers.GpxSelectionHelper)3 DialogInterface (android.content.DialogInterface)2 ImageButton (android.widget.ImageButton)2 TextView (android.widget.TextView)2 FragmentActivity (androidx.fragment.app.FragmentActivity)2 File (java.io.File)2 GpxDisplayItem (net.osmand.plus.track.helpers.GpxSelectionHelper.GpxDisplayItem)2 AlertDialog (android.app.AlertDialog)1 ProgressDialog (android.app.ProgressDialog)1 Drawable (android.graphics.drawable.Drawable)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1 Button (android.widget.Button)1 CheckBox (android.widget.CheckBox)1 CompoundButton (android.widget.CompoundButton)1