約 3,751,348 件
https://w.atwiki.jp/webword/pages/15.html
API(エー ピー アイ) Application Programming Interface(アプリケーション・プログラミング・インターフェイス)の略。 アプリケーションから利用できる、オペレーティングシステムやプログラミング言語で用意されたライブラリなどの 機能の入り口となるものである。主に、ファイル制御、ウインドウ制御、画像処理、文字制御などのための関数として 提供されることが多い。 例)『お花100選』というデータベースを持っている栄子さん。 お花のページは持っているけどデータベースはもっていない仁美さん。 栄子さんはこのデータベースを他の人にも使ってもらいたいと思っています。 そんなときに栄子さんがAPIサービスでデータベースの提供をはじめたので、 仁美さんはそのデータベースを自分のお花のページで表示できるようになりました。 また、栄子さんがデータベースの内容を更新すると仁美さんのページにも反映されます。 ・・・ざっくり言うとそんなサービスの形態
https://w.atwiki.jp/yani/pages/38.html
DirectX及びそれに関係する数学知識とその他。 メモ帳なので間違ってなかったり間違ってたり。 マクロ デグリーをラジアンに変換 D3DXToRadian( degree ) ( (degree) * (D3DX_PI / 180.0f) ) ラジアンをデグリーに変換 D3DXToDegree( radian ) ( (radian) * (180.0f / D3DX_PI) ) デグリー(degree) 360度が1周 ラジアン(radian) 2π(パイ)が1周 pVの方向に、Angleの量だけ回転した結果をpOutに格納する D3DXMatrixRotationAxis( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); 第二引数のpVは位置ベクトルではなく方向ベクトル。 なので、原点(0, 0, 0)と第二引数の位置にある点を結んだ直線が回転軸(回転方向)となる。 4x4行列の掛け算 行列の掛け算は、賭ける順序により計算結果が変わる 計算結果 = スケーリング * 回転 * 移動 とすると大体望んだ結果になる。やりたい事次第だけど。 ビルボードをしたい場合 ビルボード = 上記の計算結果 * 逆行列 指定した方向へ向きたい、角度を出したい、回転したい D3DXVECTOR3 PosA,// 回転したいオブジェクトの位置 TargetB,// ターゲット位置 AxisC,// 正面方向 (0.0f,0.0f, 1.0f)など AB,// A→Bベクトル AC;// A→Cベクトル AB = D3DXVECTOR3( TargetB - PosA );// A→Bベクトルを作成 AC = D3DXVECTOR3( AxisC - PosA );// A→Cベクトルを作成 // 正規化 D3DXVec3Normalize( AB, AB ); D3DXVec3Normalize( AC, AC ); float rot = acos( D3DXVec3Dot( AB, AC) );// 角度(なす角)を算出 // 方向を算出し、-であれば反転する if( D3DXVec3Cross( AB, AC) 0 ) { rot = -rot; } // その後は場合に応じてデグリーやラジアンに変換し使用する 例:D3DXMatrixRotationX( Mat, D3DXToRadian(rot) ); #ifndef NDEBUG // デバッグコンパイル時のみ通る処理 #endif 1次元配列を2次元配列のように扱い、その2次元配列で扱った場合の配列番号を算出する方法 2次元配列のように扱う設定は以下とする。 Xの大きさ = 10 Yの大きさ = 20 配列の合計は、Xの大きさ * Yの大きさ の200個(0~199)である。 1次元での配列番号 % Xの大きさ = Xの配列番号 1次元での配列番号 / Xの大きさ = Yの配列番号 となり、 1次元配列[ Yの配列番号 * Xの大きさ + Xの配列番号 ] という計算を行えば、目的の配列にアクセスが可能である。 例: Xの大きさ = 10 Yの大きさ = 20 合計が200配列 1次元配列[ 135 ]の場合のXとYの配列番号を知りたい。 int x, y; x = 135 % Xの大きさ; y = 135 / Xの大きさ; printf( " 1次元配列での配列番号:X = %d Y = %d" , x , y ); VC++デバッグ実行時のエラー 場所 0xfeeefeeeを読み込み中にアクセス違反が発生しました。 は、newされたオブジェクトがdeleteされた等により、 無効となったオブジェクトにアクセスをしようとして発生するエラー。 http //www.c3.club.kyutech.ac.jp/gamewiki/index.php?%C4%BA%C5%C0 http //www.sousakuba.com/Programming/gs_gaiseki.html http //special.nikkeibp.co.jp/ts/article/ab0h/127483/ Stirling めも
https://w.atwiki.jp/sampleisbest/pages/14.html
主にMicrosoft Visual C++ 2019を使用する VC++の使い方 C/C++の基礎 ファイル/ディレクトリ 画像ファイル サウンド ネットワーク 印刷 データベース COM ATL/WTL OLE シェル Windowアプリケーション DirectX その他 VC++の使い方 hello コンソール アプリケーション プロジェクトの作り方からデバッグまで MsgBox Windows アプリケーション プロジェクトの作り方からデバッグまで aaa DLLプロジェクトの作り方 trace デバッグ出力 タブの変更 文字セットの変更 文字セット(コンソール) 文字セット(Windows) Unicode文字セットとcpp Cランタイム C/C++の基礎 static [考察] 静的変数の考察 const [考察] constの考察 input [考察] コンソール入力に関する考察 scanf [考察] scanfに関する考察 isprint [考察] isprintの考察1 isprint2 [考察] isprintの考察2 size_t size_tについて bdump bit dump fdump float dump ddump double dump timetest 時間に関するテスト rand 乱数の使い方 sleep 指定された秒数スリープする locale ロケールの確認・設定 ismbb マルチバイト文字の分類 hexdmp [実用] 16進ダンプ StringBuilder StringBuilderもどき duration 処理時間の計測 エントリポイントの実験 Unicode文字列の出力 文字列リテラル ワイド文字の落とし穴 sizeofと_countof 構造体とビットフィールド long long 変数出力マクロ 4GB以上のファイル vecstr vectorの使用例 ファイル/ディレクトリ files ファイル一覧 files2 サブディレクトリ再帰ファイル一覧 files3 ファイルサイズ昇順表示 filecmp ファイルの比較 finddup [実用] 重複ファイル表示 fdmp3 MP3重複ファイル表示 IECacheSave IEキャッシュファイル保存 IECacheList [実用] IEキャッシュファイル一覧 GetFdInfo フロッピー情報の取得 fdread FDベタイメージ読み込み dirtest ファイル一覧 dircsv ファイル一覧CSV出力 filedup 重複ファイル表示 画像ファイル dumpgif GIFファイルダンプ lzwenc LZWエンコード lzwdec LZWデコード dumpjpg JPEGファイルダンプ huffman ハフマン符号のサンプル BmpViewer ビットマップ表示 ImgView [実用] 画像表示 ImgView2 [実用] 画像表示(エクスプローラの並び順) ImgView3 画像表示 gdi+test GDI+を使ってみる OlePicture OLE IPictureを使ってみる サウンド beep Beepサンプル WaveIO WaveファイルIOサンプル wave waveサンプル waveout ダイアログサンプル waveloop シングルバッファ waveloop2 ダブルバッファリング waveloop3 リアルタイム演奏(単音) wave2 wave和音サンプル wave3 平均律と周波数 wave4 音階判定 wave5 音階判定2 wavelen 自己相関による波長解析 morse モールス符号 WaveTest 波形 WaveTest2 周波数 WaveTestLR スピーカーテスト WaveGraph1 Waveグラフ表示 WaveGraph2 Waveファイルグラフ表示(相互相関) WaveGraph3 Waveファイルグラフ表示(自己相関) WaveGraph4 Waveファイル音階表示 WaveGraph5 Waveファイルグラフ表示 FreqMod FM音源の原理 FreqMod2 FM音源での音の作り方 TestMP3 MP3ファイルの再生 TestMP3_2 MP3ファイルの概要 midicaps MIDIデバイス能力の表示 EzPlay 簡易鍵盤(MIDI) Percussion 打楽器テスト GeneralMidi General MIDIテスト MidiChord MIDI 和音 MidiChord2 MIDI 和音(簡易シーケンサ) PlayMML MIDI 簡易MML演奏 PlayMML2 MIDI 簡易MMLシーケンサ mml2smf1 SMFを作る mml2smf MMLからSMFを作る code2smf コードからSMFを作る mixer ミキサー MasterVolume マスターボリューム変更(XP) MasterVolume2 マスターボリューム変更(Vista以降) MasterMute [実用] マスターボリュームミュート mcirec 録音 readtoc CD-ROM TOCの取得 readtrack CD-ROM トラックの保存 spticdda CD-ROM DirectSoundで再生 mmdev Core Audio/MMDevice API ネットワーク sock WinSockサンプル sock_s WinSockサーバー sock_c WinSockクライアント chkport ポートチェッカー PortChecker [実用] ポートチェッカー WinHttpTest WinHTTPを使ってみる WinInetTest WinInetを使ってみる 印刷 PrnTest プリンタ情報の取得 a2pr [実用] テキストファイル印刷 PrnAddr はがき宛名印刷 データベース odbcdrv ODBCドライバ一覧 odbccsv ODBC CSVファイル groupby ODBC 集計 createdb Accessデータベースの作成 sellike Accessデータベースのあいまい検索 ListView ListViewとCSVファイルの読み書き CsvDirect CSVファイルを直接書き込み COM guid GUIDの生成 FileDialog インプロセスサーバー FileOpenDialogを起動(Vista以降) wmpopen INPROC WMPを起動 WebBrowser2 アウトプロセスサーバー IEを起動 getbody IEを起動しbodyタグの内容を出力 wmpdlg atl.dllを呼び出しダイアログにWMPを貼り付ける thumbs Thumbs.dbの展開 ocxlist レジストリキーの列挙 tlblist タイプライブラリの展開 ATL/WTL wtlhello Windows Template Libraryを使ってみる ※ATL(またはWDK)/WTLが必要 atltest ATLでWMPを起動 atltest2 ATLでWMPを起動 atlmmdev Core Audio/MMDevice API OLE OleDraw mshtml ローカルhtmlファイルを描画 シェル Infotip Infotipハンドラ ContextMenu ショートカットメニュー ハンドラ Windowアプリケーション HelloWin 基本的ウィンドウ DIBSection ビットマップの利用 GetMessage GetMessageの戻り値 WorkArea タスクバーを除いたデスクトップサイズ DlgFrame ダイアログ風メインウィンドウ WinTest 最小ウィンドウサイズ、画面端吸着 ScrollTest スクロールテスト EnumFont フォント列挙 FontSample フォントサンプル表示 FontTest [考察] フォントの考察 utf16 UTF-16一覧 LayeredWnd [実用] レイヤードウィンドウ WinHexDmp 16進ダンプ Fourier フーリエ級数展開 Fourier2 フーリエ級数展開2 BallisticCurve 弾道曲線 BallisticCurve2 弾道曲線2 Mandelbrot マンデルブロ集合 DlgBase ダイアログベース DlgBase2 ダイアログベース iniファイル使用 ShellExec 指定されたファイルに対し、指定された操作を実行 ModelessDlg モードレスダイアログ Compute [考察] 時間のかかる処理 StaticDraw [考察] スタティックコントロールへの描画 RadioButton ラジオボタン ProgBar ダイアログベース プログレスバーとタイマー TrackTest トラックバー filecopy ファイルコピー EnumWnd ウィンドウ列挙 GetFileList エクスプローラのファイルリストを取得 EzTimer [実用] 簡易タイマー MultiTimer [実用] マルチタイマー devcaps デバイス能力の表示 drvtype ドライブ種別の表示 fontlist フォント名一覧 fontglyph フォントに字体があるか dw_fontlist DirectWrite フォント名一覧 dw_fontglyph DirectWrite フォントにCodePointがあるか dw_glyphcount DirectWrite フォントの持つCodePointを走査 scrsav スクリーンセーバー DirectX dxdriver ビデオドライバ表示 ※DirectX SDK (February 2010)かそれ以前が必要 udxhello DirectDraw ※DirectX SDK (February 2010)かそれ以前が必要 dxbase DirectXベース dxbase2 DirectXベース2 DxMesh メッシュファイル読み込み DxMesh2 視点操作 Shader1 頂点シェーダサンプル Shader3 HLSLレンダリングサンプル dshow1 DirectShowでファイル再生 dshow2 動画をウィンドウで再生 TestPlayer 動画プレイヤー BasicPlayback Media Foundation 動画プレイヤー MFPlayTest Media Foundation テスト dsenum DirectSoundデバイス列挙 dscaps デバイス能力表示 DxTest DirectX11テスト DxTest2 DirectX11テスト2 DxTest3 DirectX11雛形 DxTest4 DirectX11テスト2改 DxMandelbrot マンデルブロ集合 dx9sample1 DirectX 9 固定機能パイプライン dx9sample2 DirectX 9 HLSLプログラマブルシェーダ dx11sample1 DirectX 11 サンプル dx11sample2 DirectX 11 SV_VertexID dx11domino DirectX 11 ドミノ倒し DominoSaver ドミノ倒しスクリーンセーバー dx11compute1 DirectX 11 Compute Shader dx11compute2 疑似4倍精度 その他 monoff [実用] モニタの電源を切る ShellFolder シェルフォルダを使ったファイル列挙 sendinp 自動入力 dra4unit ドラゴンナイト4ユニットデータ書き換え dumphdr EXEヘッダ出力 bin2t88 バイナリ→T88ファイル作成 AATrain AA TRAIN スクリーンセーバー
https://w.atwiki.jp/nacho/pages/36.html
API APIは廃止になり現在(2019年)はESIというシステムに代わっています。 APIキー作成手順 EVE Community ①上記URLの画面上部にある【SUPPORT】の上にマウスカーソルを移動させる。 ②【API KEY MANEGIMENT】をクリックする。 ③上記画面にてAPIを作成したいアカウントの【ID】と【PASS】を入力する。 ④画面右上にある【CREATE NEW API KEY】をクリックする。 ⑤作成するAPIキーの名前を入力する。 ⑥有効期限(Expirys)を設定する。 ※特に期限が必要なければ、有効期限無し(No Expiry)に設定すること。 ⑦必要なAPI項目をクリックして追加する。 ⑧画面右下の【SUBMIT】をクリックして決定する。 ⑨上記画面の【Key ID】と【Code】を控えて使用するツールへ登録する。 ※このAPIキーは説明のために作成したため、既に削除済み! 以上でAPIキー作成手順の説明を終わります。
https://w.atwiki.jp/mccc/pages/29.html
このページでは Term API について解説する。 参考資料: Term API 執筆時のバージョン: ComputerCraft 1.55 for Minecraft 1.6.2 Term APIwrite clear clearLine getCursorPos setCursorPos setCursorBlink getSize scroll redirect restore isColor setTextColor setBackgroundColor Term API コンピュータやタートル、モニターの画面への出力を制御する。 出力文字列のフォーマットを整えるだけでなく、アスキーアートを描くのにも使える。 term.redirect関数で出力先をモニターへ切り替えた場合は、Peripheral APIで呼び出せるモニターのメソッドのラッパーAPIとして働く。 write term.write( text ) text(文字列)を画面へ出力する 戻り値:nil 文字列 text は画面のカーソル位置から出力される。 term.write関数は、print関数と違い文字列末尾では自動的に改行をせず、次の文字列は文字列 text の直後から表示される。表示位置は後述のterm.setCursorPos関数などで指定する。 例: term.write( "Hello, World!" ) 画面に文字列「Hello, World!」を出力する。 clear term.clear() 画面をクリアする 戻り値:nil カーソル位置は変わらない。 例: term.clear() term.setCursorPos( 1 , 1 ) 画面をクリアし、カーソル位置を 1, 1(初期位置)へ移動する。 clearLine term.clearLine() カーソルのある行をクリアする 戻り値:nil カーソル位置は変わらない。 getCursorPos term.getCursorPos() カーソル位置を取得する 戻り値:数値型(x), 数値型(y)。カーソル位置の座標(x, y) 画面の左上は 1, 1。 例: print( term.getCursorPos() ) カーソル位置を取得し画面に表示する。 setCursorPos term.setCursorPos( x , y ) カーソル位置を整数の座標 x(数値) , y(数値)にセットする 戻り値:nil 例: term.setCursorPos( 1 , 1 ) カーソルを画面左上へ移動する。 local oldx, oldy = term.getCursorPos() term.setCursorPos( 1 , oldy ) 現在のカーソル位置を取得し、カーソルを現在の行の先頭へ移動する。 setCursorBlink term.setCursorBlink( state ) state(ブーリアン)がtrueの場合はカーソルの点滅をONにし、falseの場合はOFFにする 戻り値:nil 例: term.setCursorBlink(true) sleep(3) term.setCursorBlink(false) sleep(3) カーソルの点滅を3秒間ONにし、さらに3秒間OFFにする。 getSize term.getSize() 画面のサイズ(右下の座標)を取得する 戻り値:数値型(x), 数値型(y)。画面のサイズ(x, y) 例: local w, h = term.getSize() term.setCursorPos(w,1) 画面のサイズを取得し、カーソルを1行目の右端へ移動する scroll term.scroll( n ) 画面を整数n(数値)行だけスクロールする 戻り値:nil redirect term.redirect( monitor ) 出力画面をmonitor(peripheral.wrap関数で取得したモニターのオブジェクト)に切り替える 戻り値:nil 【1.48-】切り替えたモニターがAdvanced Monitorの場合、モニター画面に対してクリックなどを行うと、通常のmonitor_touchイベントに加えてmouse系イベントも発生する。ちなみに、モニターへ出力しているのがAdvanced Computer/Turtleの場合、その状態でGUIに対してクリックなどを行ってもmouse系イベントが発生する。 例: term.redirect( peripheral.wrap( "right" ) ) print("Hello World!") 出力先を右にあるモニターへ切り替えて、文字列「Hello World!」を表示する。 restore term.restore() 出力先を元へ戻す 戻り値:nil 出力先をモニターへ切り替た後、出力先を元(コンピュータやタートルの画面)に戻すために使う。 例: term.redirect( peripheral.wrap( "right" ) ) -- この間、文字はモニターの方へ出力される -- term.restore() 出力先を右にあるモニターへ切り替えた後、出力先を元に戻す。 isColor 【1.45-】 term.isColor() 現在の表示デバイス(コンピュータ、モニター)がカラーに対応しているかを取得する。 戻り値:ブーリアン型。カラーに対応しているならtrue、していないならfalseが返る。 関数名は term.isColour(イギリス綴り)でも可。 CC1.55現在でtrueを返すのはAdvanced ComputerとAdvanced Turtle、Advanced Monitorのみである。 setTextColor 【1.45-】 term.setTextColor( color ) 以降の文字色を色定数color(数値)に変更する 戻り値:nil 関数名は term.setTexColour(イギリス綴り)でも可。 colorはColors APIの色定数。 colors.white、colors.black 以外の色は Advanced Computer、Advanced Monitor専用。 複数のビットが1の場合は最上位ビットの色になる。colorの値が正しくない場合はエラーとなり、色はデフォルト(白)に戻る。 setBackgroundColor 【1.45-】 term.setBackgroundColor( color ) 以降の背景色を色定数color(数値)に変更する 戻り値:nil 関数名は term.setBackgroundColour(イギリス綴り)でも可。 colorはColors APIの色定数。 colors.white、colors.black 以外の色は Advanced Computer、Advanced Monitor専用。 複数のビットが1の場合は最上位ビットの色になる。colorの値が正しくない場合はエラーとなり色は変わらないが、文字色がデフォルト(白)に戻る。
https://w.atwiki.jp/sampleisbest/pages/351.html
開発環境 Microsoft Visual Studio Express 2013 for Windows Desktop 実行環境 Microsoft Windows 8.1 (64bit) プロジェクトの種類 Visual C#/WPF アプリケーション プロジェクト名 WpfDirectX
https://w.atwiki.jp/api_programming/pages/130.html
Module Toybox Lang - API Docs 下位ページ Float String Content Module Toybox LangDefined Under Namespace Instance Method Summary Instance Method Details(String) format(format, params) フォーマット化された文字列を生成する Class Toybox Lang Float関数(要約) Float Instance Method Details(Float) abs 絶対値を返す (String) format(format) フォーマット文字列を用いて、指定した表示形式の文字列を取得する (Double) toDouble Double型に変換する (Float) toFloat Float へ変換する (Long) toLong Long 型へ変換する (Number) toNumber Number 型へ変換する Module Toybox Lang Monkey C 言語の基本型を提供する Number 32 bit 符号付き整数 Float 32 bit 浮動小数点数 Long 64 bit 整数 Double 64 bit 浮動小数点数 Booleans 真偽値 Symbols 軽量な定数 Strings 文字列 Objects Instantiated objects are defined with the class keyword. Classes are bindings of names to values. Dictionaries - Associative arrays, allocated with the syntax “new {}” or just “{}” Arrays Arrays, allocated with the syntax “new [X]” where X is an expression computing the size of the array Exceptions The base type for an error that can be handled in code with a try/catch. Used with the throw keyword. Since 1.0.0 Defined Under Namespace Classes Array, Boolean, Dictionary, Double, Exception, Float, Long, Method, Number, Object, String, Symbol, UnexpectedTypeException, WeakReference Instance Method Summary (collapse) - (String) format(format, params) Use format() to create a formatted String by substituting the given parameters into the given format at the corresponding locations. Instance Method Details (String) format(format, params) フォーマット化された文字列を生成する 与えられたフォーマットに対し、与えられパラメータ値を用いて、文字列を生成する。 与えられたフォーマット "Your next meeting is at $1$ $2$ on $3$ $4$ in room $5$." 与えられたパラメータ [2, 30, "Sep", 4, "6820"] 出力される文字列 "Your next meeting is at 2 30 on Sep 4 in room 6820." Parametersformat (String) A string using $1$, $2$, $3$… as substitution identifiers params (Array) Array of content to substitute in Returns (String) A new String with the substituted content Since 1.0.0 Class Toybox Lang Float 32ビット浮動小数点数。 d のプレフィックスがつかない限り、10進小数はデフォルトで Float になる。 Since 1.0.0 関数(要約) Float (Float) abs Use abs() to get the Absolute value of the Float. (String) format(format) Use format() to format the Float using the given formatting String. (Double) toDouble Convert the Float to a Double with toDouble(). (Float) toFloat Convert to a Float with toFloat(). (Long) toLong Convert the Float to a Long with toLong(). (Number) toNumber Convert the Float to a Number with toNumber(). Instance Method Details (Float) abs 絶対値を返す Returns (Float) Floatの絶対値 Since 1.0.0 (String) format(format) フォーマット文字列を用いて、指定した表示形式の文字列を取得する フォーマット文字列は c言語の printf 関数のフォーマットに類似する。([length] オプション は使用できない) "%[flags][width][.precision]specifier"The supported specifiers are d, i, u, o, x, X, f, e, E, g, G. flags supports only "+" and "0" width supports only numbers (* is not supported) .precision supports only numbers (* is not supported) Returns (String) A formatted String Since 1.0.0 (Double) toDouble Double型に変換する Returns (Double) A Double object Since 1.0.0 (Float) toFloat Float へ変換する Returns (Float) A Float object Since 1.0.0 (Long) toLong Long 型へ変換する Returns (Long) A Long object Since 1.0.0 (Number) toNumber Number 型へ変換する 値は 0 に向かって丸められる。例)6.8 → 6、-5.7 → -5 Returns (Number) A Number object Since 1.0.0
https://w.atwiki.jp/pluginanalogsimulate/pages/15.html
2500waves API 2500 Focusrite LIQUID MIX「TRANY C/ US CLASSIC DISCRETE 1C」 Focusrite LIQUID MIX「TRANY A/ US CLASSIC DISCRETE 1A」 560waves API 560 550Awaves API 550A Focusrite LIQUID MIX「TRANY 3 / US CLASSIC DISCRETE 3 EQ」 550Bwaves API 550B Focusrite LIQUID MIX「TRANY 4 / US CLASSIC DISCRETE 4 EQ」
https://w.atwiki.jp/api_programming/pages/145.html
http //developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/Attention.html Module Toybox AttentionDefined Under Namespace Constant Summary 関数(要約) 関数(詳細)(Object) backlight(onOff) バックライトを点灯/消灯する (Object) playTone(tone) ビープ音を鳴らす (Object) vibrate(vibe) Use the vibe motor Module Toybox Attention The Tone module allows for making pre-defined sounds. Not all devices support this API. Since 1.0.0 App Types Widget,App Defined Under Namespace Classes VibeProfile Constant Summary Supported Devices All except vivoactive TONE_KEY = 0 Indicates that a key was pressed. Since 1.0.0 TONE_START = 1 Indicates that an activity has started. Since 1.0.0 TONE_STOP = 2 Indicates that an acitivty has stopped. Since 1.0.0 TONE_MSG = 3 Indicates that a message is available. Since 1.0.0 TONE_ALERT_HI = 4 An alert ending with a high note. Since 1.0.0 TONE_ALERT_LO = 5 An alert ending with a low note. Since 1.0.0 TONE_LOUD_BEEP = 6 A loud beep. Since 1.0.0 TONE_INTERVAL_ALERT = 7 Indicates a change in interval. Since 1.0.0 TONE_ALARM = 8 Indicates an alarm has triggered. Since 1.0.0 TONE_RESET = 9 Indicates that the activity was reset. Since 1.0.0 TONE_LAP = 10 Indicates that the user has completed a lap. Since 1.0.0 TONE_CANARY = 11 An annoying sound to get the users attention. Since 1.0.0 TONE_TIME_ALERT = 12 An alert that a time threshold has been met. Since 1.0.0 TONE_DISTANCE_ALERT = 13 An alert that a distance threshold has been met. Since 1.0.0 TONE_FAILURE = 14 Indicates that the activity was a failure. Since 1.0.0 TONE_SUCCESS = 15 Indicates that the activity was a success. Since 1.0.0 TONE_POWER = 16 The power on tone. Since 1.0.0 TONE_LOW_BATTERY = 17 Indicates that the device has low battery power. Since 1.0.0 TONE_ERROR = 18 Indicates an error occurred. Since 1.0.0 関数(要約) (Object) backlight(onOff) バックライトを点灯/消灯する (Object) playTone(tone) ビープ音を鳴らす (Object) vibrate(vibe) Use the vibe motor. 関数(詳細) (Object) backlight(onOff) バックライトを点灯/消灯する ParametersonOff (Boolean) true to turn on backlight, false otherwise. Since 1.0.0 Supported Devices All devices (Object) playTone(tone) ビープ音を鳴らす Parameterstone TONE_XXX value to play Since 1.0.0 Supported Devices All except vivoactive (Object) vibrate(vibe) Use the vibe motor Parametersvibe (Array) Array of VibeProfile objects to play in sequence. Maximum of 8 supported. Since 1.0.0 Supported Devices All non-Edge devices
https://w.atwiki.jp/api_programming/pages/214.html
Index (A) » Toybox » Application » AppBase Class Toybox Application AppBase Inherits Lang Object show all Overview AppBase is the base class for an app. すべてのアプリケーションは、このクラスを継承し、その method を継承してアプリケーションのライフサイクルを管理する。 実装としては、このくらいをオーバーライドして、エントリポイントを提供し、次のメソッドでアプリケーションを操作する。 onStart() getInitialView() getGoalView() getServiceDelegate() onSettingsChanged() onStop() "widgets" と "watch-apps" では、次の順番で実行される。 onStart() getInitialView() onStop() For watch faces and data fields, only getInitialView() is called. Every AppBase object has access to an object store to persist data. Examples Shows basic app life cycle using Toybox.Application; class AppLifeCycle extends Application.AppBase { // initialize the AppBase class function initialize() { AppBase.initialize(); } // onStart() is called on application start up function onStart(state) { } // onStop() is called when your application is exiting function onStop(state) { } // Return the initial view of your application here function getInitialView() { return [new AppLifeCycleView()]; } } Since 1.0.0 Instance Method Summary collapse allowTrialMessage ⇒ Toybox Lang Boolean Check if application trial messages are allowed. clearProperties ⇒ Object deprecated Deprecated. This method will be dropped in Connect IQ 4.0.0 deleteProperty(key) ⇒ Object deprecated Deprecated. This method will be dropped in Connect IQ 4.0.0 getGoalView(goalType) ⇒ Toybox Lang Array Override to provide a WatchUi.View for a goal that has triggered within a watch face. getInitialView ⇒ Toybox Lang Array Override to provide the initial WatchUi.View and WatchUi.InputDelegate of the application. getProperty(key) ⇒ Toybox Lang Object Get the data associated with a given key from the object store. getServiceDelegate ⇒ Toybox Lang Array Get a ServiceDelegate to run background tasks for this app. getTrialDaysRemaining ⇒ Toybox Lang Number Override to return the number of days remaining in the trial. isTrial ⇒ Toybox Lang Boolean Check if the application is in trial mode. loadProperties ⇒ Object deprecated Deprecated. loadProperties() will be removed in Connect IQ 3.0.0 onBackgroundData(data) ⇒ Object Handle data passed from a ServiceDelegate to the application. onSettingsChanged ⇒ Object Called when the application settings have been changed by Garmin Connect Mobile (GCM) while while the app is running. onStart(state) ⇒ Object Method called at startup to allow handling of app initialization. onStop(state) ⇒ Object Override to handle application cleanup upon termination. saveProperties ⇒ Object deprecated Deprecated. saveProperties() will be removed in Connect IQ 3.0.0 setProperty(key, value) ⇒ Object Store the given data in the object. validateProperty(key, value) ⇒ Object Validate a property being stored. Methods inherited from Lang Object equals, hashCode, method, toString, weak Instance Method Details allowTrialMessage ⇒ Toybox Lang Boolean Check if application trial messages are allowed. Returns true if the application should allow the product to push unlock instruction pages for locked apps. Returns true by default. Returns (Toybox Lang Boolean) — Returns true if trial messages should be shown, otherwise false. Since 2.3.0 clearProperties ⇒ Object Deprecated. This method will be dropped in Connect IQ 4.0.0 Note Background processes cannot clear properties. Clear the object store for the application. Raises (Toybox Application ObjectStoreAccessException) — Thrown if clearProperties() is called from a Background process See Also Storage Since 1.0.0 deleteProperty(key) ⇒ Object Deprecated. This method will be dropped in Connect IQ 4.0.0 Note Background processes cannot delete properties. Delete the given key from the object store. Parameters key (Toybox Lang Object) — The key to delete Raises (Toybox Application ObjectStoreAccessException) — Thrown if deleteProperty() is called from a Background process See Also Storage Since 1.0.0 getGoalView(goalType) ⇒ Toybox Lang Array Override to provide a WatchUi.View for a goal that has triggered within a watch face. If a goal is reached when a watch face is running, this function will be triggered. The type of goal that was met will be provided, and the AppBase should return a View that displays a goal reached message and/or animations for that goal. If a View is returned from this function, the main watch face view will be shutdown, and then new View will pushed. If this method is not overridden in the AppBase, or if it returns null, the native goal screens will be shown. Parameters goalType (Toybox Lang Number) — The goal type that has triggered. The goalType will be from the GOAL_TYPE_* enumeration. Returns (Toybox Lang Array) — An Array containing a WatchUi.View Since 1.3.0 getInitialView ⇒ Toybox Lang Array Override to provide the initial WatchUi.View and WatchUi.InputDelegate of the application. Providing a WatchUi.InputDelegate is optional for widgets and watch-apps. For watch faces and data fields, an Array containing just a WatchUi.View should be returned as input is not available for these app types. Returns (Toybox Lang Array) — An Array containing a WatchUi.View and an optional WatchUi.InputDelegate Since 1.0.0 getProperty(key) ⇒ Toybox Lang Object Note Symbols can change from build to build and are not to be used for for Keys or Values. Get the data associated with a given key from the object store. Properties must first be set with setProperty() before they are can be obtained with getProperty. Parameters key — The key of the value to retrieve from the object store (cannot be a Symbol) Returns (Toybox Lang Object) — The content associated with the key, or null if the key is not in the object store See Also setProperty() Background Properties Storage Since 1.0.0 getServiceDelegate ⇒ Toybox Lang Array Get a ServiceDelegate to run background tasks for this app. When a ServiceDelegate is retrieved, the following will occur The method triggered within the ServiceDelegate will be run The background task will exit using Background.exit() or System.exit() The background task will be automatically terminated after 30 seconds if it is not exited by these methods Returns (Toybox Lang Array) — An Array containing a System.ServiceDelegate See Also Background Since 2.3.0 getTrialDaysRemaining ⇒ Toybox Lang Number Override to return the number of days remaining in the trial If a developer wishes to implement time-based app trials, they will need to override this function to return the number of days remaining in the trial. This function will be called on app startup to determine if a trial is active and push a notice to the user of how many days remain in the trial. Note that if allowTrialMessage() is overridden to return false, no notifications will be displayed. Returns (Toybox Lang Number) — A Number object indicating the number of days remaining in the trial, or null if no timed trial is active. Since 2.3.0 isTrial ⇒ Toybox Lang Boolean Check if the application is in trial mode. This will always return true for development build apps. If the app has been signed by the store it will return the current unlock state of the app. This method should not be overridden or your trial mode functionality could cease to function correctly. Returns (Toybox Lang Boolean) — Return true if the app is “locked” and considered to be in trial mode, otherwise false if the app has been unlocked. Since 2.3.0 loadProperties ⇒ Object Deprecated. loadProperties() will be removed in Connect IQ 3.0.0 Load the properties for the application Since 1.0.0 onBackgroundData(data) ⇒ Object Handle data passed from a ServiceDelegate to the application. When the Background process terminates, a data payload may be available. If the main application is active when this occurs, the data will be passed directly to the application s onBackgroundData() method. If the main application is not active, the data will be saved until the next time the application is launched and will be passed to the application after the onStart() method completes. Parameters data (Toybox Lang Object) — The data passed from the background process. See Also Background Since 2.3.0 onSettingsChanged ⇒ Object Called when the application settings have been changed by Garmin Connect Mobile (GCM) while while the app is running. Override this method to change app behavior when settings change. This is typically used to call for an update to the WatchUi.requestUpdate() Examples function onSettingsChanged() { // triggered by settings change in GCM _mainView.handlSettingUpdate(); WatchUi.requestUpdate(); // update the view to reflect changes } See Also WatchUi.requestUpdate() for more details Since 1.2.0 onStart(state) ⇒ Object Method called at startup to allow handling of app initialization. Before the initial WatchUi.View is retrieved, onStart() is called. Application level settings can be initialized or retrieved from the object store before the initial View is created. This method must be overridden to handle your own app initialization. Examples onStart() used with Intent function onStart(state) { if (state != null) { infoString = "Args " + state.toString(); } } Parameters state (Toybox Lang Dictionary) — Required. If an Intent is not used to launch the application, then an empty “state” Dictionary is used. If an Intent is used to start the application the Dictionary contains the arguments from the Intent. See Also Intent API Documentation Since 1.0.0 onStop(state) ⇒ Object Override to handle application cleanup upon termination. If the application needs to save data to the object store it should be done in this function. Once the function is complete, the application will terminate. Parameters state (Toybox Lang Dictionary) — Required. If an Intent is not used to launch an application on stop of the current application an empty “state” Dictionary is used. If an Intent is used to start another application, then the Dictionary contains the arguments from the Intent. See Also Intent API Documentation Since 1.0.0 saveProperties ⇒ Object Deprecated. saveProperties() will be removed in Connect IQ 3.0.0 Save the properties for the application Since 1.0.0 setProperty(key, value) ⇒ Object Note Background processes cannot save properties. Note Symbols can change from build to build and are not to be used for for Keys or Values. Store the given data in the object. Keys can be of the following types String Number Float Boolean Char Long Double Values can be of the following types String Number Float Boolean Char Long Double null Values can also be of type Array or Dictionary containing the above listed types. There is a limit on the size of the Properties of 8KB. If you reach this limit, the properties will not be saved or reloaded. Examples using Toybox.Application; var app = Application.getApp(); app.setProperty("number", 2); // set value for "number" key app.setProperty("float", 3.14); // set value for "float" key app.setProperty("string", "Hello World!"); // set value for "string" key app.setProperty("boolean", true); // set value for "boolean" key var int = app.getProperty(number); // get value for "number" key var float = app.getProperty(float); // get value for "float" key var string = app.getProperty(string); // get value for "string" key var boolean = app.getProperty(boolean); // get value for "boolean" key Parameters key — The key used to store and retrieve the value from the object store (cannot be a Symbol) value — The value to put into the object store Raises (Toybox Application ObjectStoreAccessException) — Thrown if setProperty() is called from a Background process (data should be passed back to the main application from background processes with Background.exit()) (Toybox Lang UnexpectedTypeException) — Thrown if setProperty() is called with a key or value of a disallowed type See Also getProperty() Background Programmer s Guide - Data Storage Properties Storage Since 1.0.0 validateProperty(key, value) ⇒ Object Validate a property being stored. Since 1.0.0