Changeset 244 for trunk


Ignore:
Timestamp:
07/09/06 03:57:15 (18 years ago)
Author:
Nicholas Riley
Message:

Audio support.

Location:
trunk/hiptop/pester
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/hiptop/pester/locale/en_US/Pester.rsrc

    r242 r244  
    8888#       className = "net.sabi.pester.AlarmSetDialog"
    8989        widthPct = 100
     90        centerUnderTitleBar
    9091
    9192        staticText
     
    172173                        alignTop = ID_DATE_EDITOR
    173174        endGroupBox
    174        
     175
     176        staticText
     177                text = "Alert"
     178                id = ID_ALERT_LABEL
     179                justifyRight
     180                font = boldSysFont
     181                positionBelow = ID_AT_GROUP : 5
     182                alignRight = ID_MESSAGE_LABEL
     183
     184        ringTonePicker
     185                id = ID_ALERT_PICKER
     186                # alignBaseline = ID_ALERT_LABEL
     187                positionBelow = ID_AT_GROUP : 3
     188                positionToRight = ID_ALERT_LABEL : 3
     189                fillToRight = 0
     190
    175191        button
    176192                id = ID_DISCARD_ALARM_BUTTON
  • trunk/hiptop/pester/net/sabi/pester/Alarm.java

    r243 r244  
    66import java.io.DataOutputStream;
    77import danger.app.Application;
     8import danger.audio.RingToneObject;
    89import danger.internal.Date;
    910import danger.util.LocaleUtils;
     
    2223    private int mPeriod; // XXX rename to 'interval'
    2324    private Date mDate;
     25    private RingToneObject mAlert;
    2426
    2527    // transient
     
    4749        return mDate;
    4850    }
     51    public RingToneObject getAlert() {
     52        return mAlert;
     53    }
    4954
    5055    public void setMessage(String message) {
     
    5863        mType = TYPE_DATE;
    5964        mDate = date;
     65    }
     66    public void setAlert(RingToneObject alert) {
     67        mAlert = alert.isValid() ? alert : null;
    6068    }
    6169
  • trunk/hiptop/pester/net/sabi/pester/AlarmListView.java

    r243 r244  
    33import danger.app.Application;
    44import danger.app.Event;
     5import danger.audio.ToneClass;
     6import danger.audio.ToneRights;
     7
    58import danger.internal.Date;
    69import danger.ui.ActiveListView;
     
    1619import danger.ui.RadioButton;
    1720import danger.ui.Rect;
     21import danger.ui.RingTonePicker;
    1822import danger.ui.TypeAheadTextField;
    1923import danger.util.ActiveList;
     
    3943    private DateTimeEditor sTimeEditor, sDateEditor;
    4044    private DatePicker sDatePicker;
     45    private RingTonePicker sAlertPicker;
    4146    private Button sDiscardAlarmButton, sSetAlarmButton;
    4247
     
    6469        sDateEditor = (DateTimeEditor)sEditWindow.getDescendantWithID(ID_DATE_EDITOR);
    6570        sDatePicker = (DatePicker)sEditWindow.getDescendantWithID(ID_DATE_PICKER);
     71        sAlertPicker = (RingTonePicker)sEditWindow.getDescendantWithID(ID_ALERT_PICKER);
    6672        sSetAlarmButton = (Button)sEditWindow.getDescendantWithID(ID_SET_ALARM_BUTTON);
    6773        sDiscardAlarmButton = (Button)sEditWindow.getDescendantWithID(ID_DISCARD_ALARM_BUTTON);
    6874        sInButton.setValue(1);
    6975        sDateEditor.limitToDangerEpoch();
     76        sAlertPicker.setGroupFilter(ToneClass.FOREGROUND | ToneClass.BACKGROUND |
     77                                    ToneClass.CUSTOM);
     78        sAlertPicker.setRights(ToneRights.FULL);
     79        sAlertPicker.setCanRecord(true);
    7080
    7181        super.onDecoded();
     
    118128        }
    119129        constrainDate();
     130        sAlertPicker.setRingTone(sEditingAlarm.getAlert());
    120131        sEditWindow.show();
    121132    }
     
    154165                sEditingAlarm.setDate(editingDate());
    155166            }
     167            sEditingAlarm.setAlert(sAlertPicker.getRingTone());
    156168            // schedule before adding so the tooltip is correct
    157169            sEditingAlarm.schedule();
  • trunk/hiptop/pester/net/sabi/pester/Pester.java

    r243 r244  
    2525            alert.setTitle(alert.getTitle() + ": " + alarm.getDateTimeString());
    2626            alert.setMessage(alarm.getMessage());
    27             // alert.setMessageFormatDate(alarm.getDate());
     27            alert.setShowTone(alarm.getAlert());
    2828            alert.show(AlertWindow.SYSTEM_ALERT_TYPE_ALARM);
    2929            sAlarmStack.push(alarm);
Note: See TracChangeset for help on using the changeset viewer.